Back to index

tetex-bin  3.0
c-std.h
Go to the documentation of this file.
00001 /* c-std.h: the first header files.
00002 
00003 Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
00004 
00005 This library is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU Library General Public
00007 License as published by the Free Software Foundation; either
00008 version 2 of the License, or (at your option) any later version.
00009 
00010 This library is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 Library General Public License for more details.
00014 
00015 You should have received a copy of the GNU Library General Public
00016 License along with this library; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00018 
00019 #ifndef KPATHSEA_C_STD_H
00020 #define KPATHSEA_C_STD_H
00021 
00022 /* Header files that essentially all of our sources need, and
00023    that all implementations have.  We include these first, to help with
00024    NULL being defined multiple times.  */
00025 /* Workaround against a <math.h> MSVC bug : it can't be declared 
00026    extern "C" in a c++ source file. */
00027 #ifndef __cplusplus
00028 #include <math.h>
00029 #endif
00030 #include <stdio.h>
00031 
00032 /* Be sure we have constants from <unistd.h>.  */
00033 #include <kpathsea/c-unistd.h>
00034 
00035 #ifdef HAVE_STDLIB_H
00036 #include <stdlib.h>
00037 /* Include <stdlib.h> before <stddef.h>, to help avoid NULL
00038    redefinitions on some systems.  (We don't include <stddef.h>
00039    ourselves any more, but FYI.)  */
00040 #else
00041 /* It's impossible to say for sure what the system will deign to put in
00042    <stdlib.h>, but let's hope it's at least this.  */
00043 extern char *getenv ();
00044 #endif /* not HAVE_STDLIB_H */
00045 
00046 #ifdef WIN32
00047 #include <malloc.h>
00048 #else
00049 #ifndef STDC_HEADERS
00050 #ifndef ALLOC_RETURN_TYPE
00051 #ifdef DOSISH
00052 #define ALLOC_RETURN_TYPE void
00053 #else
00054 #define ALLOC_RETURN_TYPE char
00055 #endif /* not DOSISH */
00056 #endif /* not ALLOC_RETURN_TYPE */
00057 extern ALLOC_RETURN_TYPE *calloc (), *malloc (), *realloc ();
00058 #endif /* not STDC_HEADERS */
00059 #endif /* not WIN32 */
00060 
00061 /* SunOS 4.1.1 gets STDC_HEADERS defined, but it doesn't provide
00062    EXIT_FAILURE.  So far no system has defined one of EXIT_FAILURE and
00063    EXIT_SUCCESS without the other.  */
00064 #ifndef EXIT_SUCCESS
00065 #ifdef VMS
00066 #define EXIT_SUCCESS 1
00067 #define EXIT_FAILURE 0
00068 #else
00069 #define EXIT_SUCCESS 0
00070 #define EXIT_FAILURE 1
00071 #endif
00072 #endif /* not EXIT_SUCCESS */
00073 
00074 /* strchr vs. index, memcpy vs. bcopy, etc.  */
00075 #include <kpathsea/c-memstr.h>
00076 
00077 /* Error numbers and errno declaration.  */
00078 #include <kpathsea/c-errno.h>
00079 
00080 /* Numeric minima and maxima.  */
00081 #include <kpathsea/c-minmax.h>
00082 
00083 /* Assertions are too useful to not make generally available.  */
00084 #ifdef HAVE_ASSERT_H
00085 #include <assert.h>
00086 #else
00087 #define assert(expr) /* as nothing */
00088 #endif
00089 
00090 #ifdef VMS
00091 #include <unixlib.h>
00092 #include <unixio.h>
00093 #else
00094 #ifndef WIN32
00095 /* `popen' and `pclose' are part of POSIX.2, not POSIX.1.  So
00096    STDC_HEADERS isn't enough.  */
00097 extern FILE *popen ();
00098 extern int pclose ();
00099 #endif /* not WIN32 */
00100 #endif /* not VMS */
00101 
00102 #endif /* not KPATHSEA_C_STD_H */