]> pd.if.org Git - pdclib/blob - functions/_PDCLIB/errno.c
9f84d339c0a68b12d893fd3a99da66424362341a
[pdclib] / functions / _PDCLIB / errno.c
1 /* _PDCLIB_errno
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #include "_PDCLIB_int.h"
8
9 #ifndef REGTEST
10
11 int _PDCLIB_errno = 0;
12
13 int * _PDCLIB_errno_func()
14 {
15     return &_PDCLIB_errno;
16 }
17
18 #endif
19
20 #ifdef TEST
21
22 #include "_PDCLIB_test.h"
23
24 #include <errno.h>
25
26 int main( void )
27 {
28     errno = 0;
29     TESTCASE( errno == 0 );
30     errno = EDOM;
31     TESTCASE( errno == EDOM );
32     errno = ERANGE;
33     TESTCASE( errno == ERANGE );
34     return TEST_RESULTS;
35 }
36
37 #endif