]>
jfr.im git - irc/evilnet/x3.git/blob - src/compat.h
6 /* AIX's compiler requires this to be the first thing in the compiled
7 * files. Yay for braindead compilers. */
8 #if defined(__GNUC__) && !defined(HAVE_ALLOCA_H)
9 # define alloca __builtin_alloca
11 # if defined(HAVE_ALLOCA_H)
24 /* These are ANSI C89 headers, so everybody should have them. If
25 * they're missing, we probably don't care much about the platform.
26 * If we do, we can add an autoconf test and try to patch around;
27 * this is the right file for that, after all :)
41 #ifdef TIME_WITH_SYS_TIME
42 # include <sys/time.h>
45 # ifdef HAVE_SYS_TIME_H
46 # include <sys/time.h>
52 #ifdef HAVE_SYS_TYPES_H
53 #include <sys/types.h>
61 #define VA_COPY(DEST, SRC) va_copy(DEST, SRC)
63 #define VA_COPY(DEST, SRC) __va_copy(DEST, SRC)
65 #define VA_COPY(DEST, SRC) memcpy(&(DEST), &(SRC), sizeof(DEST))
68 #ifndef HAVE_GETTIMEOFDAY
69 extern int gettimeofday(struct timeval
* tv
, struct timezone
* tz
);
73 /* this should use size_t, but some systems don't define it */
74 extern void * memcpy(void * dest
, void const * src
, unsigned long n
);
78 /* this should use size_t, but some systems don't define it */
79 extern void * memset(void * dest
, int c
, unsigned long n
);
83 extern char * strdup(char const * str
);
87 extern char const * strerror(int errornum
);