]> pd.if.org Git - pdclib/blob - functions/_PDCLIB/errno.c
* Test cleanups: surround the code for all functions by #ifndef REGTEST
[pdclib] / functions / _PDCLIB / errno.c
1 /* $Id$ */
2
3 /* _PDCLIB_errno
4
5    This file is part of the Public Domain C Library (PDCLib).
6    Permission is granted to use, modify, and / or redistribute at will.
7 */
8
9 #ifndef REGTEST
10 #include <_PDCLIB_int.h>
11
12 int _PDCLIB_errno = 0;
13
14 int * _PDCLIB_errno_func()
15 {
16     return &_PDCLIB_errno;
17 }
18
19 #endif
20
21 #ifdef TEST
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
38