appease sun - nil is now just 0 instead of (void*)0
to fix function pointer problems.
This commit is contained in:
parent
1f8a80722f
commit
aaa502d3a3
2 changed files with 16 additions and 12 deletions
|
|
@ -13,7 +13,9 @@ extern "C" {
|
||||||
* Begin usual libc.h
|
* Begin usual libc.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef nil
|
||||||
#define nil ((void*)0)
|
#define nil ((void*)0)
|
||||||
|
#endif
|
||||||
#define nelem(x) (sizeof(x)/sizeof((x)[0]))
|
#define nelem(x) (sizeof(x)/sizeof((x)[0]))
|
||||||
|
|
||||||
#ifndef offsetof
|
#ifndef offsetof
|
||||||
|
|
|
||||||
26
include/u.h
26
include/u.h
|
|
@ -39,38 +39,44 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
# if defined(__Linux26__)
|
||||||
|
# include <pthread.h>
|
||||||
|
# define PLAN9PORT_USING_PTHREADS 1
|
||||||
|
# endif
|
||||||
# if defined(__USE_MISC)
|
# if defined(__USE_MISC)
|
||||||
# undef _NEEDUSHORT
|
# undef _NEEDUSHORT
|
||||||
# undef _NEEDUINT
|
# undef _NEEDUINT
|
||||||
# undef _NEEDULONG
|
# undef _NEEDULONG
|
||||||
# endif
|
# endif
|
||||||
# if defined(__Linux26__)
|
|
||||||
# define PLAN9PORT_USING_PTHREADS 1
|
|
||||||
# endif
|
|
||||||
#elif defined(__sun__)
|
#elif defined(__sun__)
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
# include <pthread.h>
|
||||||
|
# define PLAN9PORT_USING_PTHREADS 1
|
||||||
# undef _NEEDUSHORT
|
# undef _NEEDUSHORT
|
||||||
# undef _NEEDUINT
|
# undef _NEEDUINT
|
||||||
# undef _NEEDULONG
|
# undef _NEEDULONG
|
||||||
# define PLAN9PORT_USING_PTHREADS 1
|
# define nil 0 /* no cast to void* */
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__)
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include <osreldate.h>
|
# include <osreldate.h>
|
||||||
|
# if __FreeBSD_version >= 500000
|
||||||
|
# define PLAN9PORT_USING_PTHREADS 1
|
||||||
|
# include <pthread.h>
|
||||||
|
# endif
|
||||||
# if !defined(_POSIX_SOURCE)
|
# if !defined(_POSIX_SOURCE)
|
||||||
# undef _NEEDUSHORT
|
# undef _NEEDUSHORT
|
||||||
# undef _NEEDUINT
|
# undef _NEEDUINT
|
||||||
# endif
|
# endif
|
||||||
# if __FreeBSD_version >= 500000
|
|
||||||
# define PLAN9PORT_USING_PTHREADS 1
|
|
||||||
# endif
|
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
# include <pthread.h>
|
||||||
|
# define PLAN9PORT_USING_PTHREADS 1
|
||||||
# undef _NEEDUSHORT
|
# undef _NEEDUSHORT
|
||||||
# undef _NEEDUINT
|
# undef _NEEDUINT
|
||||||
# define _NEEDLL 1
|
# define _NEEDLL 1
|
||||||
# define PLAN9PORT_USING_PTHREADS 1
|
|
||||||
#else
|
#else
|
||||||
/* No idea what system this is -- try some defaults */
|
/* No idea what system this is -- try some defaults */
|
||||||
|
# include <pthread.h>
|
||||||
# define PLAN9PORT_USING_PTHREADS 1
|
# define PLAN9PORT_USING_PTHREADS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -78,10 +84,6 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
|
||||||
#define O_DIRECT 0
|
#define O_DIRECT 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PLAN9PORT_USING_PTHREADS
|
|
||||||
#include <pthread.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef signed char schar;
|
typedef signed char schar;
|
||||||
typedef unsigned int u32int;
|
typedef unsigned int u32int;
|
||||||
typedef int s32int;
|
typedef int s32int;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue