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 _NETBSD_SOURCE 1 /* NetBSD */
12 #define _SVID_SOURCE 1
13 #define _XOPEN_SOURCE 1000
14 #define _XOPEN_SOURCE_EXTENDED 1
15 #define _LARGEFILE64_SOURCE 1
16 #define _FILE_OFFSET_BITS 64
29 #include <ctype.h> /* for tolower */
39 typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
41 #if defined(__linux__)
42 # include <sys/types.h>
43 # if defined(__Linux26__)
45 # define PLAN9PORT_USING_PTHREADS 1
47 # if defined(__USE_MISC)
52 #elif defined(__sun__)
53 # include <sys/types.h>
55 # define PLAN9PORT_USING_PTHREADS 1
59 # define nil 0 /* no cast to void* */
60 #elif defined(__FreeBSD__)
61 # include <sys/types.h>
62 # include <osreldate.h>
63 # if __FreeBSD_version >= 500000
64 # define PLAN9PORT_USING_PTHREADS 1
67 # if !defined(_POSIX_SOURCE)
71 #elif defined(__APPLE__)
72 # include <sys/types.h>
74 # define PLAN9PORT_USING_PTHREADS 1
78 #elif defined(__NetBSD__)
80 # include <sys/types.h>
84 #elif defined(__OpenBSD__)
89 /* No idea what system this is -- try some defaults */
91 # define PLAN9PORT_USING_PTHREADS 1
98 typedef signed char schar;
99 typedef unsigned int u32int;
103 typedef unsigned char uchar;
106 typedef unsigned short ushort;
109 typedef unsigned int uint;
112 typedef unsigned long ulong;
114 typedef unsigned long long uvlong;
115 typedef long long vlong;
116 typedef uvlong u64int;
117 typedef vlong s64int;
120 typedef ushort u16int;
121 typedef short s16int;
129 * Funny-named symbols to tip off 9l to autolink.
131 #define AUTOLIB(x) static int __p9l_autolib_ ## x = 1;
134 * Gcc 3 is too smart for its own good.
136 #if defined(__GNUC__) && !defined(__APPLE_CC__)
139 # define AUTOLIB(x) int __p9l_autolib_ ## x __attribute__ ((weak));
143 #if defined(__cplusplus)