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
14 # define _XOPEN_SOURCE 1000
15 # define _XOPEN_SOURCE_EXTENDED 1
17 #define _LARGEFILE64_SOURCE 1
18 #define _FILE_OFFSET_BITS 64
31 #include <ctype.h> /* for tolower */
41 typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
43 #if defined(__linux__)
44 # include <sys/types.h>
45 # if defined(__Linux26__)
47 # define PLAN9PORT_USING_PTHREADS 1
49 # if defined(__USE_MISC)
54 #elif defined(__sun__)
55 # include <sys/types.h>
57 # define PLAN9PORT_USING_PTHREADS 1
61 # define nil 0 /* no cast to void* */
62 #elif defined(__FreeBSD__)
63 # include <sys/types.h>
64 # include <osreldate.h>
65 # if __FreeBSD_version >= 500000
66 # define PLAN9PORT_USING_PTHREADS 1
69 # if !defined(_POSIX_SOURCE)
73 #elif defined(__APPLE__)
74 # include <sys/types.h>
76 # define PLAN9PORT_USING_PTHREADS 1
82 # undef _POSIX_C_SOURCE
88 #elif defined(__NetBSD__)
90 # include <sys/types.h>
94 #elif defined(__OpenBSD__)
99 /* No idea what system this is -- try some defaults */
100 # include <pthread.h>
101 # define PLAN9PORT_USING_PTHREADS 1
108 typedef signed char schar;
109 typedef unsigned int u32int;
113 typedef unsigned char uchar;
116 typedef unsigned short ushort;
119 typedef unsigned int uint;
122 typedef unsigned long ulong;
124 typedef unsigned long long uvlong;
125 typedef long long vlong;
126 typedef uvlong u64int;
127 typedef vlong s64int;
130 typedef ushort u16int;
131 typedef short s16int;
139 * Funny-named symbols to tip off 9l to autolink.
141 #define AUTOLIB(x) static int __p9l_autolib_ ## x = 1;
144 * Gcc is too smart for its own good.
146 #if defined(__GNUC__)
147 # if __GNUC__ >= 4 || (__GNUC__==3 && !defined(__APPLE_CC__))
149 # define AUTOLIB(x) int __p9l_autolib_ ## x __attribute__ ((weak));
152 # define AUTOLIB(x) static int __p9l_autolib_ ## x __attribute__ ((unused));
156 #if defined(__cplusplus)