From e9df99b12ef9fefdbc1c05ff51bddffe723051e9 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 14 Jun 2009 09:54:58 -0700 Subject: Drop #ifdef USG checks for some truly ancient (pre-SVR4) SysV's Signed-off-by: Alan Coopersmith --- Xos.h | 63 ++++++++++++++++----------------------------------------------- Xos_r.h | 2 +- 2 files changed, 17 insertions(+), 48 deletions(-) diff --git a/Xos.h b/Xos.h index e16f473..646716b 100644 --- a/Xos.h +++ b/Xos.h @@ -39,14 +39,7 @@ in this Software without prior written authorization from The Open Group. * Get major data types (esp. caddr_t) */ -# ifdef USG -# ifndef __TYPES__ -# include /* forgot to protect it... */ -# define __TYPES__ -# endif /* __TYPES__ */ -# else /* USG */ -# include -# endif /* USG */ +# include # if defined(__SCO__) || defined(__UNIXWARE__) # include @@ -100,56 +93,32 @@ in this Software without prior written authorization from The Open Group. * Get struct timeval and struct tm */ -# if defined(SYSV) - -# ifndef USL -# include -# endif -# include -# if defined(USG) -struct timeval { - long tv_sec; - long tv_usec; -}; -# ifndef USL_SHARELIB -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; -# endif /* USL_SHARELIB */ -# endif /* USG */ - - -# else /* not SYSV */ - -# if defined(_POSIX_SOURCE) && defined(SVR4) +# if defined(_POSIX_SOURCE) && defined(SVR4) /* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */ -# undef _POSIX_SOURCE -# include -# define _POSIX_SOURCE -# elif defined(WIN32) -# include -# if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_) && !defined(_TIMEVAL_DEFINED) && !defined(_STRUCT_TIMEVAL) +# undef _POSIX_SOURCE +# include +# define _POSIX_SOURCE +# elif defined(WIN32) +# include +# if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_) && !defined(_TIMEVAL_DEFINED) && !defined(_STRUCT_TIMEVAL) struct timeval { long tv_sec; /* seconds */ long tv_usec; /* and microseconds */ }; -# define _TIMEVAL_DEFINED -# endif -# include -# define gettimeofday(t) \ +# define _TIMEVAL_DEFINED +# endif +# include +# define gettimeofday(t) \ { \ struct _timeb _gtodtmp; \ _ftime (&_gtodtmp); \ (t)->tv_sec = _gtodtmp.time; \ (t)->tv_usec = _gtodtmp.millitm * 1000; \ } -# else -# include -# include -# endif /* defined(_POSIX_SOURCE) && defined(SVR4) */ - -# endif /* SYSV */ +# else +# include +# include +# endif /* defined(_POSIX_SOURCE) && defined(SVR4) */ /* define X_GETTIMEOFDAY macro, a portable gettimeofday() */ # if defined(_XOPEN_XPG4) || defined(_XOPEN_UNIX) /* _XOPEN_UNIX is XPG4.2 */ diff --git a/Xos_r.h b/Xos_r.h index 96e14cd..f963b64 100644 --- a/Xos_r.h +++ b/Xos_r.h @@ -535,7 +535,7 @@ typedef int _Xgetservbynameparams; /* dummy */ #if defined(X_INCLUDE_DIRENT_H) && !defined(_XOS_INCLUDED_DIRENT_H) # include -# if !defined(X_NOT_POSIX) || defined(SYSV) || defined(USG) +# if !defined(X_NOT_POSIX) || defined(SYSV) # include # else # include -- cgit v1.2.3