From e6b106715f24112d1dc7a84c6e37df4b5debb2d0 Mon Sep 17 00:00:00 2001 From: Richard PALO Date: Tue, 17 Nov 2015 07:02:07 +0100 Subject: [PATCH] Replace 'sun' with '__sun' Globally replace #ifdef and #if defined usage of 'sun' with '__sun' such that strict ISO compiler modes such as -ansi or -std=c99 can be used. Signed-off-by: Richard PALO Reviewed-by: Alan Coopersmith --- hw/kdrive/src/kinput.c | 2 +- hw/xfree86/common/xf86AutoConfig.c | 10 +++++----- hw/xfree86/common/xf86Globals.c | 2 +- hw/xfree86/common/xf86Privstr.h | 2 +- hw/xfree86/common/xf86cmap.c | 2 +- hw/xfree86/loader/os.c | 2 +- hw/xfree86/os-support/bus/Sbus.c | 4 ++-- hw/xfree86/os-support/xf86_OSlib.h | 22 +++++++++++----------- os/access.c | 8 ++++---- os/backtrace.c | 2 +- os/io.c | 2 +- os/rpcauth.c | 2 +- xkb/xkbInit.c | 2 +- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index d5741f100..84b980ff3 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -34,7 +34,7 @@ #endif #include #include -#ifdef sun +#ifdef __sun #include /* needed for FNONBLOCK & FASYNC */ #endif diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 6b8d0eb89..e6ab900aa 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -45,7 +45,7 @@ #include "xf86sbusBus.h" #endif -#ifdef sun +#ifdef __sun #include #include #endif @@ -202,7 +202,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches) #ifdef XSERVER_PLATFORM_BUS i = xf86PlatformMatchDriver(matches, nmatches); #endif -#ifdef sun +#ifdef __sun /* Check for driver type based on /dev/fb type and if valid, use it instead of PCI bus probe results */ if (xf86Info.consoleFd >= 0 && (i < (nmatches - 1))) { @@ -271,7 +271,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches) matches[i++] = xnfstrdup("modesetting"); #endif -#if !defined(sun) +#if !defined(__sun) /* Fallback to platform default frame buffer driver */ if (i < (nmatches - 1)) { #if !defined(__linux__) && defined(__sparc__) @@ -280,13 +280,13 @@ listPossibleVideoDrivers(char *matches[], int nmatches) matches[i++] = xnfstrdup("fbdev"); #endif } -#endif /* !sun */ +#endif /* !__sun */ /* Fallback to platform default hardware */ if (i < (nmatches - 1)) { #if defined(__i386__) || defined(__amd64__) || defined(__hurd__) matches[i++] = xnfstrdup("vesa"); -#elif defined(__sparc__) && !defined(sun) +#elif defined(__sparc__) && !defined(__sun) matches[i++] = xnfstrdup("sunffb"); #endif } diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c index 93a35b80e..86bf15dc2 100644 --- a/hw/xfree86/common/xf86Globals.c +++ b/hw/xfree86/common/xf86Globals.c @@ -98,7 +98,7 @@ xf86InfoRec xf86Info = { .vtno = -1, .lastEventTime = -1, .vtRequestsPending = FALSE, -#ifdef sun +#ifdef __sun .vtPendingNum = -1, #endif .dontVTSwitch = FALSE, diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h index cffa14d01..2eefeaf83 100644 --- a/hw/xfree86/common/xf86Privstr.h +++ b/hw/xfree86/common/xf86Privstr.h @@ -55,7 +55,7 @@ typedef struct { /* event handler part */ int lastEventTime; Bool vtRequestsPending; -#ifdef sun +#ifdef __sun int vtPendingNum; #endif Bool dontVTSwitch; diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c index 704e35358..ba0b277a1 100644 --- a/hw/xfree86/common/xf86cmap.c +++ b/hw/xfree86/common/xf86cmap.c @@ -29,7 +29,7 @@ #include #endif -#if defined(_XOPEN_SOURCE) || defined(sun) && defined(__SVR4) +#if defined(_XOPEN_SOURCE) || defined(__sun) && defined(__SVR4) #include #else #define _XOPEN_SOURCE /* to get prototype for pow on some systems */ diff --git a/hw/xfree86/loader/os.c b/hw/xfree86/loader/os.c index e3a9ac448..8d037217b 100644 --- a/hw/xfree86/loader/os.c +++ b/hw/xfree86/loader/os.c @@ -50,7 +50,7 @@ #define OSNAME "openbsd" #elif defined(__GNU__) #define OSNAME "hurd" -#elif defined(SVR4) && defined(sun) +#elif defined(SVR4) && defined(__sun) #define OSNAME "solaris" #elif defined(SVR5) #define OSNAME "svr5" diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c index 86b4d685a..a5265770c 100644 --- a/hw/xfree86/os-support/bus/Sbus.c +++ b/hw/xfree86/os-support/bus/Sbus.c @@ -31,7 +31,7 @@ #include #include #include -#ifdef sun +#ifdef __sun #include #endif #include "xf86.h" @@ -173,7 +173,7 @@ promIsP1275(void) break; } fclose(f); -#elif defined(sun) +#elif defined(__sun) struct utsname buffer; if ((uname(&buffer) >= 0) && !strcmp(buffer.machine, "sun4u")) diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h index c7b295ae9..5d78c66e3 100644 --- a/hw/xfree86/os-support/xf86_OSlib.h +++ b/hw/xfree86/os-support/xf86_OSlib.h @@ -84,7 +84,7 @@ /* SYSV386 (SVR3, SVR4), including Solaris */ /**************************************************************************/ #if (defined(SYSV) || defined(SVR4)) && \ - (defined(sun) || defined(__i386__)) + (defined(__sun) || defined(__i386__)) #include #include #include @@ -94,21 +94,21 @@ #include #if defined(_NEED_SYSI86) -#if !(defined (sun) && defined (SVR4)) +#if !(defined (__sun) && defined (SVR4)) #include #include #include #endif #include #include -#if defined(SVR4) && !defined(sun) +#if defined(SVR4) && !defined(__sun) #include -#endif /* SVR4 && !sun */ +#endif /* SVR4 && !__sun */ /* V86SC_IOPL was moved to on Solaris 7 and later */ #if !defined(V86SC_IOPL) /* Solaris 7 or later? */ #include /* Nope */ #endif -#if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4) +#if defined(__sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4) #include #endif #endif /* _NEED_SYSI86 */ @@ -122,14 +122,14 @@ #include /* MMAP driver header */ #endif -#if !defined(sun) || defined(HAVE_SYS_VT_H) +#if !defined(__sun) || defined(HAVE_SYS_VT_H) #define HAS_USL_VTS #endif -#if !defined(sun) +#if !defined(__sun) #include #endif #if defined(HAS_USL_VTS) -#if !defined(sun) +#if !defined(__sun) #include #endif #include @@ -139,7 +139,7 @@ extern _X_HIDDEN void xf86VTAcquire(int); extern _X_HIDDEN void xf86VTRelease(int); #endif -#if defined(sun) +#if defined(__sun) #include extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; @@ -156,7 +156,7 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; #define LED_NUM LED_NUM_LOCK #define LED_SCR LED_SCROLL_LOCK #define LED_COMP LED_COMPOSE -#endif /* sun */ +#endif /* __sun */ #if !defined(VT_ACKACQ) #define VT_ACKACQ 2 @@ -164,7 +164,7 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; #if defined(SVR4) #include -#if !(defined(sun) && defined (SVR4)) +#if !(defined(__sun) && defined (SVR4)) #define DEV_MEM "/dev/pmem" #endif #define CLEARDTR_SUPPORT diff --git a/os/access.c b/os/access.c index 2499a9f12..10a48c37d 100644 --- a/os/access.c +++ b/os/access.c @@ -112,7 +112,7 @@ SOFTWARE. #ifdef HAVE_GETPEERUCRED #include -#ifdef sun +#ifdef __sun #include #endif #endif @@ -162,7 +162,7 @@ SOFTWARE. * Test for Solaris commented out -- TSI @ UQV 2003.06.13 */ #ifdef SIOCGLIFCONF -/* #if defined(sun) */ +/* #if defined(__sun) */ #define USE_SIOCGLIFCONF /* #endif */ #endif @@ -383,7 +383,7 @@ AccessUsingXdmcp(void) LocalHostEnabled = FALSE; } -#if defined(SVR4) && !defined(sun) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) +#if defined(SVR4) && !defined(__sun) && defined(SIOCGIFCONF) && !defined(USE_SIOCGLIFCONF) /* Deal with different SIOCGIFCONF ioctl semantics on these OSs */ @@ -1145,7 +1145,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec ** lccp) if (client == NULL) return -1; ci = ((OsCommPtr) client->osPrivate)->trans_conn; -#if !(defined(sun) && defined(HAVE_GETPEERUCRED)) +#if !(defined(__sun) && defined(HAVE_GETPEERUCRED)) /* Most implementations can only determine peer credentials for Unix * domain sockets - Solaris getpeerucred can work with a bit more, so * we just let it tell us if the connection type is supported or not diff --git a/os/backtrace.c b/os/backtrace.c index fd129ef21..9e3e38edf 100644 --- a/os/backtrace.c +++ b/os/backtrace.c @@ -155,7 +155,7 @@ xorg_backtrace(void) #else /* not glibc or glibc < 2.1 */ -#if defined(sun) && defined(__SVR4) +#if defined(__sun) && defined(__SVR4) #define HAVE_PSTACK #endif diff --git a/os/io.c b/os/io.c index 96a243d8c..55644eaf3 100644 --- a/os/io.c +++ b/os/io.c @@ -368,7 +368,7 @@ ReadRequestFromClient(ClientPtr client) oci->size - oci->bufcnt); if (result <= 0) { if ((result < 0) && ETEST(errno)) { -#if defined(SVR4) && defined(__i386__) && !defined(sun) +#if defined(SVR4) && defined(__i386__) && !defined(__sun) if (0) #endif { diff --git a/os/rpcauth.c b/os/rpcauth.c index 413cc6118..5680489f7 100644 --- a/os/rpcauth.c +++ b/os/rpcauth.c @@ -46,7 +46,7 @@ from The Open Group. #include -#ifdef sun +#ifdef __sun /* only includes this if _KERNEL is #defined... */ extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); #endif diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c index 30e10bd15..9c772f549 100644 --- a/xkb/xkbInit.c +++ b/xkb/xkbInit.c @@ -60,7 +60,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define LED_NUM 5 #define PHYS_LEDS 0x1f #else -#ifdef sun +#ifdef __sun #define LED_NUM 1 #define LED_SCROLL 2 #define LED_COMPOSE 3