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
80 # undef _POSIX_C_SOURCE
85 #elif defined(__NetBSD__)
87 # include <sys/types.h>
91 #elif defined(__OpenBSD__)
96 /* No idea what system this is -- try some defaults */
98 # define PLAN9PORT_USING_PTHREADS 1
105 typedef signed char schar;
106 typedef unsigned int u32int;
110 typedef unsigned char uchar;
113 typedef unsigned short ushort;
116 typedef unsigned int uint;
119 typedef unsigned long ulong;
121 typedef unsigned long long uvlong;
122 typedef long long vlong;
123 typedef uvlong u64int;
124 typedef vlong s64int;
127 typedef ushort u16int;
128 typedef short s16int;
136 * Funny-named symbols to tip off 9l to autolink.
138 #define AUTOLIB(x) static int __p9l_autolib_ ## x = 1;
141 * Gcc is too smart for its own good.
143 #if defined(__GNUC__)
144 # if __GNUC__ >= 4 || (__GNUC__==3 && !defined(__APPLE_CC__))
146 # define AUTOLIB(x) int __p9l_autolib_ ## x __attribute__ ((weak));
149 # define AUTOLIB(x) static int __p9l_autolib_ ## x __attribute__ ((unused));
153 #if defined(__cplusplus)