mirror of
https://gitlab.freedesktop.org/xorg/proto/xorgproto.git
synced 2025-12-25 20:00:13 +01:00
Drop #ifdef USG checks for some truly ancient (pre-SVR4) SysV's
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
This commit is contained in:
parent
385c1343f7
commit
e9df99b12e
2 changed files with 17 additions and 48 deletions
63
Xos.h
63
Xos.h
|
|
@ -39,14 +39,7 @@ in this Software without prior written authorization from The Open Group.
|
||||||
* Get major data types (esp. caddr_t)
|
* Get major data types (esp. caddr_t)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# ifdef USG
|
# include <sys/types.h>
|
||||||
# ifndef __TYPES__
|
|
||||||
# include <sys/types.h> /* forgot to protect it... */
|
|
||||||
# define __TYPES__
|
|
||||||
# endif /* __TYPES__ */
|
|
||||||
# else /* USG */
|
|
||||||
# include <sys/types.h>
|
|
||||||
# endif /* USG */
|
|
||||||
|
|
||||||
# if defined(__SCO__) || defined(__UNIXWARE__)
|
# if defined(__SCO__) || defined(__UNIXWARE__)
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
|
|
@ -100,56 +93,32 @@ in this Software without prior written authorization from The Open Group.
|
||||||
* Get struct timeval and struct tm
|
* Get struct timeval and struct tm
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# if defined(SYSV)
|
# if defined(_POSIX_SOURCE) && defined(SVR4)
|
||||||
|
|
||||||
# ifndef USL
|
|
||||||
# include <sys/time.h>
|
|
||||||
# endif
|
|
||||||
# include <time.h>
|
|
||||||
# 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)
|
|
||||||
/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
|
/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
|
||||||
# undef _POSIX_SOURCE
|
# undef _POSIX_SOURCE
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
# define _POSIX_SOURCE
|
# define _POSIX_SOURCE
|
||||||
# elif defined(WIN32)
|
# elif defined(WIN32)
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
# if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_) && !defined(_TIMEVAL_DEFINED) && !defined(_STRUCT_TIMEVAL)
|
# if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_) && !defined(_TIMEVAL_DEFINED) && !defined(_STRUCT_TIMEVAL)
|
||||||
struct timeval {
|
struct timeval {
|
||||||
long tv_sec; /* seconds */
|
long tv_sec; /* seconds */
|
||||||
long tv_usec; /* and microseconds */
|
long tv_usec; /* and microseconds */
|
||||||
};
|
};
|
||||||
# define _TIMEVAL_DEFINED
|
# define _TIMEVAL_DEFINED
|
||||||
# endif
|
# endif
|
||||||
# include <sys/timeb.h>
|
# include <sys/timeb.h>
|
||||||
# define gettimeofday(t) \
|
# define gettimeofday(t) \
|
||||||
{ \
|
{ \
|
||||||
struct _timeb _gtodtmp; \
|
struct _timeb _gtodtmp; \
|
||||||
_ftime (&_gtodtmp); \
|
_ftime (&_gtodtmp); \
|
||||||
(t)->tv_sec = _gtodtmp.time; \
|
(t)->tv_sec = _gtodtmp.time; \
|
||||||
(t)->tv_usec = _gtodtmp.millitm * 1000; \
|
(t)->tv_usec = _gtodtmp.millitm * 1000; \
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
# include <sys/time.h>
|
# include <sys/time.h>
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
# endif /* defined(_POSIX_SOURCE) && defined(SVR4) */
|
# endif /* defined(_POSIX_SOURCE) && defined(SVR4) */
|
||||||
|
|
||||||
# endif /* SYSV */
|
|
||||||
|
|
||||||
/* define X_GETTIMEOFDAY macro, a portable gettimeofday() */
|
/* define X_GETTIMEOFDAY macro, a portable gettimeofday() */
|
||||||
# if defined(_XOPEN_XPG4) || defined(_XOPEN_UNIX) /* _XOPEN_UNIX is XPG4.2 */
|
# if defined(_XOPEN_XPG4) || defined(_XOPEN_UNIX) /* _XOPEN_UNIX is XPG4.2 */
|
||||||
|
|
|
||||||
2
Xos_r.h
2
Xos_r.h
|
|
@ -535,7 +535,7 @@ typedef int _Xgetservbynameparams; /* dummy */
|
||||||
|
|
||||||
#if defined(X_INCLUDE_DIRENT_H) && !defined(_XOS_INCLUDED_DIRENT_H)
|
#if defined(X_INCLUDE_DIRENT_H) && !defined(_XOS_INCLUDED_DIRENT_H)
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# if !defined(X_NOT_POSIX) || defined(SYSV) || defined(USG)
|
# if !defined(X_NOT_POSIX) || defined(SYSV)
|
||||||
# include <dirent.h>
|
# include <dirent.h>
|
||||||
# else
|
# else
|
||||||
# include <sys/dir.h>
|
# include <sys/dir.h>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue