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 */27 #include <pthread.h> /* for Locks */29 /*30 * OS-specific crap31 */32 #define _NEEDUCHAR 133 #define _NEEDUSHORT 134 #define _NEEDUINT 135 #define _NEEDULONG 137 typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];39 #if defined(__linux__)40 # include <sys/types.h>41 # if defined(__USE_MISC)42 # undef _NEEDUSHORT43 # undef _NEEDUINT44 # undef _NEEDULONG45 # include <pthread.h>46 # define PLAN9_PTHREADS47 # endif48 #endif49 #if defined(__sun__)50 # include <sys/types.h>51 # undef _NEEDUSHORT52 # undef _NEEDUINT53 # undef _NEEDULONG54 # include <pthread.h>55 # define PLAN9_PTHREADS56 #endif57 #if defined(__FreeBSD__)58 # include <sys/types.h>59 # if !defined(_POSIX_SOURCE)60 # undef _NEEDUSHORT61 # undef _NEEDUINT62 # endif63 #endif64 #if defined(__APPLE__)65 # include <sys/types.h>66 # undef _NEEDUSHORT67 # undef _NEEDUINT68 # define _NEEDLL 169 # include <pthread.h>70 # define PLAN9_PTHREADS71 #endif74 typedef signed char schar;75 typedef unsigned int u32int;76 typedef int s32int;78 #ifdef _NEEDUCHAR79 typedef unsigned char uchar;80 #endif81 #ifdef _NEEDUSHORT82 typedef unsigned short ushort;83 #endif84 #ifdef _NEEDUINT85 typedef unsigned int uint;86 #endif87 #ifdef _NEEDULONG88 typedef unsigned long ulong;89 #endif90 typedef unsigned long long uvlong;91 typedef long long vlong;92 typedef uvlong u64int;93 typedef vlong s64int;94 typedef uchar u8int;95 typedef schar s8int;96 typedef ushort u16int;97 typedef short s16int;99 #undef _NEEDUCHAR100 #undef _NEEDUSHORT101 #undef _NEEDUINT102 #undef _NEEDULONG104 #if defined(__cplusplus)105 }106 #endif107 #endif