From aaa502d3a330a84ac835fd902b01f2834e2fc40a Mon Sep 17 00:00:00 2001 From: rsc Date: Tue, 15 Mar 2005 16:12:51 +0000 Subject: appease sun - nil is now just 0 instead of (void*)0 to fix function pointer problems. --- include/u.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'include/u.h') diff --git a/include/u.h b/include/u.h index dd9b1682..54f4df59 100644 --- a/include/u.h +++ b/include/u.h @@ -39,38 +39,44 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #if defined(__linux__) # include +# if defined(__Linux26__) +# include +# define PLAN9PORT_USING_PTHREADS 1 +# endif # if defined(__USE_MISC) # undef _NEEDUSHORT # undef _NEEDUINT # undef _NEEDULONG # endif -# if defined(__Linux26__) -# define PLAN9PORT_USING_PTHREADS 1 -# endif #elif defined(__sun__) # include +# include +# define PLAN9PORT_USING_PTHREADS 1 # undef _NEEDUSHORT # undef _NEEDUINT # undef _NEEDULONG -# define PLAN9PORT_USING_PTHREADS 1 +# define nil 0 /* no cast to void* */ #elif defined(__FreeBSD__) # include # include +# if __FreeBSD_version >= 500000 +# define PLAN9PORT_USING_PTHREADS 1 +# include +# endif # if !defined(_POSIX_SOURCE) # undef _NEEDUSHORT # undef _NEEDUINT # endif -# if __FreeBSD_version >= 500000 -# define PLAN9PORT_USING_PTHREADS 1 -# endif #elif defined(__APPLE__) # include +# include +# define PLAN9PORT_USING_PTHREADS 1 # undef _NEEDUSHORT # undef _NEEDUINT # define _NEEDLL 1 -# define PLAN9PORT_USING_PTHREADS 1 #else /* No idea what system this is -- try some defaults */ +# include # define PLAN9PORT_USING_PTHREADS 1 #endif @@ -78,10 +84,6 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)]; #define O_DIRECT 0 #endif -#ifdef PLAN9PORT_USING_PTHREADS -#include -#endif - typedef signed char schar; typedef unsigned int u32int; typedef int s32int; -- cgit v1.2.3