Blame


1 8ad51794 2004-03-25 devnull #ifndef _U_H_
2 8ad51794 2004-03-25 devnull #define _U_H_ 1
3 8ad51794 2004-03-25 devnull #if defined(__cplusplus)
4 8ad51794 2004-03-25 devnull extern "C" {
5 8ad51794 2004-03-25 devnull #endif
6 8ad51794 2004-03-25 devnull
7 39b3054a 2004-12-25 devnull #define __BSD_VISIBLE 1 /* FreeBSD 5.x */
8 39b3054a 2004-12-25 devnull #define __EXTENSIONS__ 1 /* SunOS */
9 8ad51794 2004-03-25 devnull #define _BSD_SOURCE 1
10 8ad51794 2004-03-25 devnull #define _SVID_SOURCE 1
11 8ad51794 2004-03-25 devnull #define _XOPEN_SOURCE 1000
12 8ad51794 2004-03-25 devnull #define _XOPEN_SOURCE_EXTENDED 1
13 8ad51794 2004-03-25 devnull #define _LARGEFILE64_SOURCE 1
14 8ad51794 2004-03-25 devnull #define _FILE_OFFSET_BITS 64
15 8ad51794 2004-03-25 devnull
16 8ad51794 2004-03-25 devnull #include <unistd.h>
17 8ad51794 2004-03-25 devnull #include <string.h>
18 8ad51794 2004-03-25 devnull #include <stdlib.h>
19 8ad51794 2004-03-25 devnull #include <stdarg.h>
20 8ad51794 2004-03-25 devnull #include <fcntl.h>
21 8ad51794 2004-03-25 devnull #include <assert.h>
22 8ad51794 2004-03-25 devnull #include <setjmp.h>
23 8ad51794 2004-03-25 devnull #include <stddef.h>
24 8ad51794 2004-03-25 devnull #include <utf.h>
25 8ad51794 2004-03-25 devnull #include <fmt.h>
26 8ad51794 2004-03-25 devnull #include <math.h>
27 c8af1ab1 2004-04-19 devnull #include <ctype.h> /* for tolower */
28 8ad51794 2004-03-25 devnull
29 8ad51794 2004-03-25 devnull /*
30 8ad51794 2004-03-25 devnull * OS-specific crap
31 8ad51794 2004-03-25 devnull */
32 8ad51794 2004-03-25 devnull #define _NEEDUCHAR 1
33 8ad51794 2004-03-25 devnull #define _NEEDUSHORT 1
34 8ad51794 2004-03-25 devnull #define _NEEDUINT 1
35 8ad51794 2004-03-25 devnull #define _NEEDULONG 1
36 8ad51794 2004-03-25 devnull
37 8ad51794 2004-03-25 devnull typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
38 8ad51794 2004-03-25 devnull
39 8ad51794 2004-03-25 devnull #if defined(__linux__)
40 8ad51794 2004-03-25 devnull # include <sys/types.h>
41 8ad51794 2004-03-25 devnull # if defined(__USE_MISC)
42 8ad51794 2004-03-25 devnull # undef _NEEDUSHORT
43 8ad51794 2004-03-25 devnull # undef _NEEDUINT
44 8ad51794 2004-03-25 devnull # undef _NEEDULONG
45 8ad51794 2004-03-25 devnull # endif
46 c6687d45 2004-09-21 devnull # if defined(__Linux26__)
47 39b3054a 2004-12-25 devnull # define PLAN9PORT_USING_PTHREADS 1
48 c6687d45 2004-09-21 devnull # endif
49 39b3054a 2004-12-25 devnull #elif defined(__sun__)
50 8ad51794 2004-03-25 devnull # include <sys/types.h>
51 8ad51794 2004-03-25 devnull # undef _NEEDUSHORT
52 8ad51794 2004-03-25 devnull # undef _NEEDUINT
53 8ad51794 2004-03-25 devnull # undef _NEEDULONG
54 39b3054a 2004-12-25 devnull # define PLAN9PORT_USING_PTHREADS 1
55 39b3054a 2004-12-25 devnull #elif defined(__FreeBSD__)
56 8ad51794 2004-03-25 devnull # include <sys/types.h>
57 8ad51794 2004-03-25 devnull # if !defined(_POSIX_SOURCE)
58 8ad51794 2004-03-25 devnull # undef _NEEDUSHORT
59 8ad51794 2004-03-25 devnull # undef _NEEDUINT
60 8ad51794 2004-03-25 devnull # endif
61 39b3054a 2004-12-25 devnull # if defined(__FreeBSD5__)
62 39b3054a 2004-12-25 devnull # define PLAN9PORT_USING_PTHREADS 1
63 39b3054a 2004-12-25 devnull # endif
64 39b3054a 2004-12-25 devnull #elif defined(__APPLE__)
65 8ad51794 2004-03-25 devnull # include <sys/types.h>
66 8ad51794 2004-03-25 devnull # undef _NEEDUSHORT
67 8ad51794 2004-03-25 devnull # undef _NEEDUINT
68 8ad51794 2004-03-25 devnull # define _NEEDLL 1
69 39b3054a 2004-12-25 devnull # define PLAN9PORT_USING_PTHREADS 1
70 39b3054a 2004-12-25 devnull #else
71 39b3054a 2004-12-25 devnull /* No idea what system this is -- try some defaults */
72 39b3054a 2004-12-25 devnull # define PLAN9PORT_USING_PTHREADS 1
73 8ad51794 2004-03-25 devnull #endif
74 8ad51794 2004-03-25 devnull
75 39b3054a 2004-12-25 devnull #ifndef O_DIRECT
76 39b3054a 2004-12-25 devnull #define O_DIRECT 0
77 39b3054a 2004-12-25 devnull #endif
78 06bb4ed2 2004-09-17 devnull
79 39b3054a 2004-12-25 devnull #ifdef PLAN9PORT_USING_PTHREADS
80 39b3054a 2004-12-25 devnull #include <pthread.h>
81 39b3054a 2004-12-25 devnull #endif
82 39b3054a 2004-12-25 devnull
83 8ad51794 2004-03-25 devnull typedef signed char schar;
84 8ad51794 2004-03-25 devnull typedef unsigned int u32int;
85 785a7364 2004-04-19 devnull typedef int s32int;
86 785a7364 2004-04-19 devnull
87 8ad51794 2004-03-25 devnull #ifdef _NEEDUCHAR
88 8ad51794 2004-03-25 devnull typedef unsigned char uchar;
89 8ad51794 2004-03-25 devnull #endif
90 8ad51794 2004-03-25 devnull #ifdef _NEEDUSHORT
91 8ad51794 2004-03-25 devnull typedef unsigned short ushort;
92 8ad51794 2004-03-25 devnull #endif
93 8ad51794 2004-03-25 devnull #ifdef _NEEDUINT
94 8ad51794 2004-03-25 devnull typedef unsigned int uint;
95 8ad51794 2004-03-25 devnull #endif
96 8ad51794 2004-03-25 devnull #ifdef _NEEDULONG
97 8ad51794 2004-03-25 devnull typedef unsigned long ulong;
98 8ad51794 2004-03-25 devnull #endif
99 8ad51794 2004-03-25 devnull typedef unsigned long long uvlong;
100 8ad51794 2004-03-25 devnull typedef long long vlong;
101 8ad51794 2004-03-25 devnull typedef uvlong u64int;
102 785a7364 2004-04-19 devnull typedef vlong s64int;
103 8ad51794 2004-03-25 devnull typedef uchar u8int;
104 785a7364 2004-04-19 devnull typedef schar s8int;
105 8ad51794 2004-03-25 devnull typedef ushort u16int;
106 785a7364 2004-04-19 devnull typedef short s16int;
107 8ad51794 2004-03-25 devnull
108 8ad51794 2004-03-25 devnull #undef _NEEDUCHAR
109 8ad51794 2004-03-25 devnull #undef _NEEDUSHORT
110 8ad51794 2004-03-25 devnull #undef _NEEDUINT
111 8ad51794 2004-03-25 devnull #undef _NEEDULONG
112 8ad51794 2004-03-25 devnull
113 8ad51794 2004-03-25 devnull #if defined(__cplusplus)
114 8ad51794 2004-03-25 devnull }
115 8ad51794 2004-03-25 devnull #endif
116 8ad51794 2004-03-25 devnull #endif