3 #if defined(__cplusplus)
7 #define __BSD_VISIBLE 1 /* FreeBSD 5.x */
8 #define __EXTENSIONS__ 1 /* SunOS */
9 /* NOT USING #define __MAKECONTEXT_V2_SOURCE 1 / * SunOS */
11 #define _SVID_SOURCE 1
12 #define _XOPEN_SOURCE 1000
13 #define _XOPEN_SOURCE_EXTENDED 1
14 #define _LARGEFILE64_SOURCE 1
15 #define _FILE_OFFSET_BITS 64
28 #include <ctype.h> /* for tolower */
38 typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
40 #if defined(__linux__)
41 # include <sys/types.h>
42 # if defined(__Linux26__)
44 # define PLAN9PORT_USING_PTHREADS 1
46 # if defined(__USE_MISC)
51 #elif defined(__sun__)
52 # include <sys/types.h>
54 # define PLAN9PORT_USING_PTHREADS 1
58 # define nil 0 /* no cast to void* */
59 #elif defined(__FreeBSD__)
60 # include <sys/types.h>
61 # include <osreldate.h>
62 # if __FreeBSD_version >= 500000
63 # define PLAN9PORT_USING_PTHREADS 1
66 # if !defined(_POSIX_SOURCE)
70 #elif defined(__APPLE__)
71 # include <sys/types.h>
73 # define PLAN9PORT_USING_PTHREADS 1
78 /* No idea what system this is -- try some defaults */
80 # define PLAN9PORT_USING_PTHREADS 1
87 typedef signed char schar;
88 typedef unsigned int u32int;
92 typedef unsigned char uchar;
95 typedef unsigned short ushort;
98 typedef unsigned int uint;
101 typedef unsigned long ulong;
103 typedef unsigned long long uvlong;
104 typedef long long vlong;
105 typedef uvlong u64int;
106 typedef vlong s64int;
109 typedef ushort u16int;
110 typedef short s16int;
118 * Funny-named symbols to tip off 9l to autolink.
120 #define AUTOLIB(x) static int __p9l_autolib_ ## x = 1;
123 * Gcc 3 is too smart for its own good.
125 #if defined(__GNUC__) && !defined(__APPLE_CC__)
128 # define AUTOLIB(x) int __p9l_autolib_ ## x __attribute__ ((weak));
132 #if defined(__cplusplus)