Blob
1 #ifndef _U_H_2 #define _U_H_ 13 #if defined(__cplusplus)4 extern "C" {5 #endif7 #define _BSD_SOURCE 18 #define _SVID_SOURCE 19 #define _XOPEN_SOURCE 100010 #define _XOPEN_SOURCE_EXTENDED 111 #define _LARGEFILE64_SOURCE 112 #define _FILE_OFFSET_BITS 6413 #define __EXTENSIONS__ 1 /* SunOS */15 #include <unistd.h>16 #include <string.h>17 #include <stdlib.h>18 #include <stdarg.h>19 #include <fcntl.h>20 #include <assert.h>21 #include <setjmp.h>22 #include <stddef.h>23 #include <utf.h>24 #include <fmt.h>25 #include <math.h>26 #include <ctype.h> /* for tolower */28 /*29 * OS-specific crap30 */31 #define _NEEDUCHAR 132 #define _NEEDUSHORT 133 #define _NEEDUINT 134 #define _NEEDULONG 136 typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];38 #if defined(__linux__)39 # include <sys/types.h>40 # if defined(__USE_MISC)41 # undef _NEEDUSHORT42 # undef _NEEDUINT43 # undef _NEEDULONG44 # endif45 # if defined(__Linux26__)46 # include <pthread.h>47 # define PLAN9_PTHREADS 148 # endif49 #endif50 #if defined(__sun__)51 # include <sys/types.h>52 # undef _NEEDUSHORT53 # undef _NEEDUINT54 # undef _NEEDULONG55 # include <pthread.h>56 # define PLAN9_PTHREADS57 #endif58 #if defined(__FreeBSD__)59 # include <sys/types.h>60 # if !defined(_POSIX_SOURCE)61 # undef _NEEDUSHORT62 # undef _NEEDUINT63 # endif64 #endif65 #if defined(__APPLE__)66 # include <sys/types.h>67 # undef _NEEDUSHORT68 # undef _NEEDUINT69 # define _NEEDLL 170 # include <pthread.h>71 # define PLAN9_PTHREADS72 #endif75 typedef signed char schar;76 typedef unsigned int u32int;77 typedef int s32int;79 #ifdef _NEEDUCHAR80 typedef unsigned char uchar;81 #endif82 #ifdef _NEEDUSHORT83 typedef unsigned short ushort;84 #endif85 #ifdef _NEEDUINT86 typedef unsigned int uint;87 #endif88 #ifdef _NEEDULONG89 typedef unsigned long ulong;90 #endif91 typedef unsigned long long uvlong;92 typedef long long vlong;93 typedef uvlong u64int;94 typedef vlong s64int;95 typedef uchar u8int;96 typedef schar s8int;97 typedef ushort u16int;98 typedef short s16int;100 #undef _NEEDUCHAR101 #undef _NEEDUSHORT102 #undef _NEEDUINT103 #undef _NEEDULONG105 #if defined(__cplusplus)106 }107 #endif108 #endif