commit - 1f8a80722f44d9c24c4a48d21a944947c9a34b96
commit + aaa502d3a330a84ac835fd902b01f2834e2fc40a
blob - e495a535b51921641ea698402d619a4f0525f83b
blob + ac8ffa9d943f9f43475d34e944e6d74faa9d03a3
--- include/libc.h
+++ include/libc.h
* Begin usual libc.h
*/
+#ifndef nil
#define nil ((void*)0)
+#endif
#define nelem(x) (sizeof(x)/sizeof((x)[0]))
#ifndef offsetof
blob - dd9b16821f3f23f4c85c251d5fda9e8dd4723f73
blob + 54f4df594213f6ad09ce74e5f07a1596d21048ec
--- include/u.h
+++ include/u.h
#if defined(__linux__)
# include <sys/types.h>
+# if defined(__Linux26__)
+# include <pthread.h>
+# 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 <sys/types.h>
+# include <pthread.h>
+# 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 <sys/types.h>
# include <osreldate.h>
+# if __FreeBSD_version >= 500000
+# define PLAN9PORT_USING_PTHREADS 1
+# include <pthread.h>
+# endif
# if !defined(_POSIX_SOURCE)
# undef _NEEDUSHORT
# undef _NEEDUINT
# endif
-# if __FreeBSD_version >= 500000
-# define PLAN9PORT_USING_PTHREADS 1
-# endif
#elif defined(__APPLE__)
# include <sys/types.h>
+# include <pthread.h>
+# 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 <pthread.h>
# define PLAN9PORT_USING_PTHREADS 1
#endif
#define O_DIRECT 0
#endif
-#ifdef PLAN9PORT_USING_PTHREADS
-#include <pthread.h>
-#endif
-
typedef signed char schar;
typedef unsigned int u32int;
typedef int s32int;