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(__USE_MISC)
47 # if defined(__Linux26__)
48 # define PLAN9PORT_USING_PTHREADS 1
50 #elif defined(__sun__)
51 # include <sys/types.h>
55 # define PLAN9PORT_USING_PTHREADS 1
56 #elif defined(__FreeBSD__)
57 # include <sys/types.h>
58 # include <osreldate.h>
59 # if !defined(_POSIX_SOURCE)
63 # if __FreeBSD_version >= 500000
64 # define PLAN9PORT_USING_PTHREADS 1
66 #elif defined(__APPLE__)
67 # include <sys/types.h>
71 # define PLAN9PORT_USING_PTHREADS 1
73 /* No idea what system this is -- try some defaults */
74 # define PLAN9PORT_USING_PTHREADS 1
81 #ifdef PLAN9PORT_USING_PTHREADS
85 typedef signed char schar;
86 typedef unsigned int u32int;
90 typedef unsigned char uchar;
93 typedef unsigned short ushort;
96 typedef unsigned int uint;
99 typedef unsigned long ulong;
101 typedef unsigned long long uvlong;
102 typedef long long vlong;
103 typedef uvlong u64int;
104 typedef vlong s64int;
107 typedef ushort u16int;
108 typedef short s16int;
116 * Funny-named symbols to tip off 9l to autolink.
118 #define AUTOLIB(x) static int __p9l_autolib_ ## x = 1;
121 * Gcc 3 is too smart for its own good.
123 #if defined(__GNUC__) && !defined(__APPLE_CC__)
126 # define AUTOLIB(x) int __p9l_autolib_ ## x __attribute__ ((weak));
130 #if defined(__cplusplus)