From e78a844b37920ac10bc5a5e558dbecea7e00518c Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 23 May 2005 15:04:02 +0000 Subject: 21270: don't use poll() on Apple --- ChangeLog | 4 ++++ Src/system.h | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 70 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9af808c6f..3d00b54ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-05-23 Peter Stephenson + + * 21270: Src/system.h: don't use poll() on Apple. + 2005-05-10 Oliver Kiddle * Haakon Riiser: 21188: Completion/X/Command/_acroread: handle diff --git a/Src/system.h b/Src/system.h index 31be575ef..41195364d 100644 --- a/Src/system.h +++ b/Src/system.h @@ -27,9 +27,23 @@ * */ +#if 0 +/* + * Setting _XPG_IV here is actually wrong and is not needed + * with currently supported versions (5.43C20 and above) + */ #ifdef sinix # define _XPG_IV 1 #endif +#endif + +#ifdef __linux +/* + * Turn on numerous extensions. + * This is in order to get the functions for manipulating /dev/ptmx. + */ +#define _GNU_SOURCE 1 +#endif /* NeXT has half-implemented POSIX support * * which currently fools configure */ @@ -83,6 +97,16 @@ char *alloca _((size_t)); # include #endif +#ifdef HAVE_STDDEF_H +/* + * Seen on Solaris 8 with gcc: stddef defines offsetof, which clashes + * with system.h's definition of the symbol unless we include this + * first. Otherwise, this will be hooked in by wchar.h, too late + * for comfort. + */ +#include +#endif + #include #include #include @@ -194,19 +218,21 @@ struct timezone { # define VARARR(X,Y,Z) X *(Y) = (X *) alloca(sizeof(X) * (Z)) #endif -/* we should be getting this value from pathconf(_PC_PATH_MAX) */ -/* but this is too much trouble */ +/* we should handle unlimited sizes from pathconf(_PC_PATH_MAX) */ +/* but this is too much trouble */ #ifndef PATH_MAX # ifdef MAXPATHLEN # define PATH_MAX MAXPATHLEN # else - /* so we will just pick something */ -# define PATH_MAX 1024 +# ifdef _POSIX_PATH_MAX +# define PATH_MAX _POSIX_PATH_MAX +# else + /* so we will just pick something */ +# define PATH_MAX 1024 +# endif # endif #endif -/* we should be getting this value from sysconf(_SC_OPEN_MAX) */ -/* but this is too much trouble */ #ifndef OPEN_MAX # ifdef NOFILE # define OPEN_MAX NOFILE @@ -215,6 +241,9 @@ struct timezone { # define OPEN_MAX 64 # endif #endif +#ifndef HAVE_SYSCONF +# define zopenmax() ((long) OPEN_MAX) +#endif #ifdef HAVE_FCNTL_H # include @@ -271,6 +300,15 @@ struct timezone { # include #endif +#if defined(__APPLE__) && defined(HAVE_SELECT) +/* + * Prefer select() to poll() on MacOS X since poll() is known + * to be problematic in 10.4 + */ +#undef HAVE_POLL +#undef HAVE_POLL_H +#endif + #ifdef HAVE_SYS_FILIO_H # include #endif @@ -299,10 +337,6 @@ struct timezone { # endif /* HAVE_TERMIO_H */ #endif /* HAVE_TERMIOS_H */ -#ifdef HAVE_TERMCAP_H -# include -#endif - #if defined(GWINSZ_IN_SYS_IOCTL) || defined(CLOBBERS_TYPEAHEAD) # include #endif @@ -399,8 +433,10 @@ struct timezone { /* DIGBUFSIZ is the length of a buffer which can hold the -LONG_MAX-1 * * (or with ZSH_64_BIT_TYPE maybe -LONG_LONG_MAX-1) * * converted to printable decimal form including the sign and the * - * terminating null character. Below 0.30103 > lg 2. */ -#define DIGBUFSIZE ((int)(((sizeof(zlong) * 8) - 1) * 0.30103) + 3) + * terminating null character. Below 0.30103 > lg 2. * + * BDIGBUFSIZE is for a number converted to printable binary form. */ +#define DIGBUFSIZE ((int)(((sizeof(zlong) * 8) - 1) * 30103/100000) + 3) +#define BDIGBUFSIZE ((int)((sizeof(zlong) * 8) + 4)) /* If your stat macros are broken, we will * * just undefine them. */ @@ -642,3 +678,21 @@ extern short ospeed; #if defined(CONFIG_LOCALE) && defined(HAVE_SETLOCALE) && defined(LC_ALL) # define USE_LOCALE 1 #endif /* CONFIG_LOCALE && HAVE_SETLOCALE && LC_ALL */ + +#ifndef MAILDIR_SUPPORT +#define mailstat(X,Y) stat(X,Y) +#endif + +#ifdef __CYGWIN__ +# include +# define IS_DIRSEP(c) ((c) == '/' || (c) == '\\') +#else +# define IS_DIRSEP(c) ((c) == '/') +#endif + +#if defined(__GNUC__) && !defined(__APPLE__) +/* Does the OS X port of gcc still gag on __attribute__? */ +#define UNUSED(x) x __attribute__((__unused__)) +#else +#define UNUSED(x) x +#endif -- cgit 1.4.1