diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-08-21 11:21:52 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-08-21 11:21:52 -0700 |
commit | b4e47d3807da4f204dbee8682dac98318f913bd0 (patch) | |
tree | 8620b3a16bc6f2d91c24d8022d78ff78cc02d68e | |
parent | bcc112ca1ba3505899d97ef0502fcb0fb4d6e0a0 (diff) | |
download | xorg-lib-libXmu-b4e47d3807da4f204dbee8682dac98318f913bd0.tar.gz |
get_os_name: Use autoconf to detect uname() support
Stop maintaining a list of #ifdefs for ancient platforms
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | src/CvtStdSel.c | 36 |
2 files changed, 11 insertions, 26 deletions
diff --git a/configure.ac b/configure.ac index 1ac8612..4afe3d5 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,7 @@ PKG_CHECK_MODULES(XMU, xt xext x11 xextproto) PKG_CHECK_MODULES(XMUU, x11) # Checks for library functions. +AC_CHECK_FUNCS([uname]) AC_REPLACE_FUNCS([reallocarray]) # Allow checking code with lint, sparse, etc. diff --git a/src/CvtStdSel.c b/src/CvtStdSel.c index 177de1b..439ab7a 100644 --- a/src/CvtStdSel.c +++ b/src/CvtStdSel.c @@ -65,26 +65,14 @@ in this Software without prior written authorization from The Open Group. #include <X11/Xfuncs.h> #ifndef OS_NAME -#ifndef X_OS_FILE -#ifdef SYSV /* keep separate until makedepend fixed */ -#define USE_UNAME -#endif -#ifdef SVR4 -#define USE_UNAME -#endif -#ifdef ultrix -#define USE_UNAME -#endif -#ifdef CSRG_BASED -#define USE_UNAME -#endif -#ifdef __linux__ -#define USE_UNAME -#endif -#endif /*X_OS_FILE*/ -#ifdef USE_UNAME -#include <sys/utsname.h> -#endif +# ifndef X_OS_FILE +# ifdef HAVE_UNAME +# define USE_UNAME +# endif +# endif /*X_OS_FILE*/ +# ifdef USE_UNAME +# include <sys/utsname.h> +# endif #endif /* @@ -148,14 +136,10 @@ get_os_name(void) } #endif -#ifdef sun - return XtNewString("SunOS"); -#else -# if !defined(SYSV) && (defined(CSRG_BASED) || defined(unix)) +#if !defined(SYSV) && (defined(CSRG_BASED) || defined(unix)) return XtNewString("BSD"); -# else +#else return NULL; -# endif #endif #endif /*OS_NAME*/ |