tentative fix for issue 3 (ex 53)
[mplib] / src / texk / kpathsea / c-std.h
1 /* c-std.h: the first header files.
2
3    Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2008 Karl Berry.
4    Copyright 1999, 2005 Olaf Weber
5
6    This library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    This library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public License
17    along with this library; if not, see <http://www.gnu.org/licenses/>.  */
18
19 #ifndef KPATHSEA_C_STD_H
20 #define KPATHSEA_C_STD_H
21
22 /* Header files that essentially all of our sources need, and
23    that all implementations have.  We include these first, to help with
24    NULL being defined multiple times.  */
25 /* Workaround against a <math.h> MSVC bug : it can't be declared 
26    extern "C" in a c++ source file. */
27 #ifndef __cplusplus
28 #include <math.h>
29 #endif
30 #include <stdio.h>
31
32 /* Be sure we have constants from <unistd.h>.  */
33 #include <kpathsea/c-unistd.h>
34
35 #ifdef HAVE_STDLIB_H
36 #include <stdlib.h>
37 /* Include <stdlib.h> before <stddef.h>, to help avoid NULL
38    redefinitions on some systems.  (We don't include <stddef.h>
39    ourselves any more, but FYI.)  */
40 #else
41 /* It's impossible to say for sure what the system will deign to put in
42    <stdlib.h>, but let's hope it's at least this.  */
43 extern char *getenv ();
44 #endif /* not HAVE_STDLIB_H */
45
46 #ifdef WIN32
47 #include <malloc.h>
48 #else
49 #ifndef STDC_HEADERS
50 #ifndef ALLOC_RETURN_TYPE
51 #ifdef DOSISH
52 #define ALLOC_RETURN_TYPE void
53 #els
54 #define ALLOC_RETURN_TYPE char
55 #endif /* not DOSISH */
56 #endif /* not ALLOC_RETURN_TYPE */
57 extern ALLOC_RETURN_TYPE *calloc (), *malloc (), *realloc ();
58 #endif /* not STDC_HEADERS */
59 #endif /* not WIN32 */
60
61 /* SunOS 4.1.1 gets STDC_HEADERS defined, but it doesn't provide
62    EXIT_FAILURE.  So far no system has defined one of EXIT_FAILURE and
63    EXIT_SUCCESS without the other.  */
64 #ifndef EXIT_SUCCESS
65 #ifdef VMS
66 #define EXIT_SUCCESS 1
67 #define EXIT_FAILURE 0
68 #else
69 #define EXIT_SUCCESS 0
70 #define EXIT_FAILURE 1
71 #endif
72 #endif /* not EXIT_SUCCESS */
73
74 /* strchr vs. index, memcpy vs. bcopy, etc.  */
75 #include <kpathsea/c-memstr.h>
76
77 /* Error numbers and errno declaration.  */
78 #include <kpathsea/c-errno.h>
79
80 /* Numeric minima and maxima.  */
81 #include <kpathsea/c-minmax.h>
82
83 /* Assertions are too useful to not make generally available.  */
84 #ifdef HAVE_ASSERT_H
85 #include <assert.h>
86 #else
87 #define assert(expr) /* as nothing */
88 #endif
89
90 #ifdef VMS
91 #include <unixlib.h>
92 #include <unixio.h>
93 #else
94 #ifndef WIN32
95 /* `popen' and `pclose' are part of POSIX.2, not POSIX.1.  So
96    STDC_HEADERS isn't enough.  */
97 extern FILE *popen ();
98 extern int pclose ();
99 #endif /* not WIN32 */
100 #endif /* not VMS */
101
102 #endif /* not KPATHSEA_C_STD_H */