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 <richard@NetBSD.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
Richard PALO 2015-11-17 07:02:07 +01:00 committed by Adam Jackson
parent 44d0fd435a
commit e6b106715f
13 changed files with 31 additions and 31 deletions

View File

@ -34,7 +34,7 @@
#endif #endif
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
#ifdef sun #ifdef __sun
#include <sys/file.h> /* needed for FNONBLOCK & FASYNC */ #include <sys/file.h> /* needed for FNONBLOCK & FASYNC */
#endif #endif

View File

@ -45,7 +45,7 @@
#include "xf86sbusBus.h" #include "xf86sbusBus.h"
#endif #endif
#ifdef sun #ifdef __sun
#include <sys/visual_io.h> #include <sys/visual_io.h>
#include <ctype.h> #include <ctype.h>
#endif #endif
@ -202,7 +202,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches)
#ifdef XSERVER_PLATFORM_BUS #ifdef XSERVER_PLATFORM_BUS
i = xf86PlatformMatchDriver(matches, nmatches); i = xf86PlatformMatchDriver(matches, nmatches);
#endif #endif
#ifdef sun #ifdef __sun
/* Check for driver type based on /dev/fb type and if valid, use /* Check for driver type based on /dev/fb type and if valid, use
it instead of PCI bus probe results */ it instead of PCI bus probe results */
if (xf86Info.consoleFd >= 0 && (i < (nmatches - 1))) { if (xf86Info.consoleFd >= 0 && (i < (nmatches - 1))) {
@ -271,7 +271,7 @@ listPossibleVideoDrivers(char *matches[], int nmatches)
matches[i++] = xnfstrdup("modesetting"); matches[i++] = xnfstrdup("modesetting");
#endif #endif
#if !defined(sun) #if !defined(__sun)
/* Fallback to platform default frame buffer driver */ /* Fallback to platform default frame buffer driver */
if (i < (nmatches - 1)) { if (i < (nmatches - 1)) {
#if !defined(__linux__) && defined(__sparc__) #if !defined(__linux__) && defined(__sparc__)
@ -280,13 +280,13 @@ listPossibleVideoDrivers(char *matches[], int nmatches)
matches[i++] = xnfstrdup("fbdev"); matches[i++] = xnfstrdup("fbdev");
#endif #endif
} }
#endif /* !sun */ #endif /* !__sun */
/* Fallback to platform default hardware */ /* Fallback to platform default hardware */
if (i < (nmatches - 1)) { if (i < (nmatches - 1)) {
#if defined(__i386__) || defined(__amd64__) || defined(__hurd__) #if defined(__i386__) || defined(__amd64__) || defined(__hurd__)
matches[i++] = xnfstrdup("vesa"); matches[i++] = xnfstrdup("vesa");
#elif defined(__sparc__) && !defined(sun) #elif defined(__sparc__) && !defined(__sun)
matches[i++] = xnfstrdup("sunffb"); matches[i++] = xnfstrdup("sunffb");
#endif #endif
} }

View File

@ -98,7 +98,7 @@ xf86InfoRec xf86Info = {
.vtno = -1, .vtno = -1,
.lastEventTime = -1, .lastEventTime = -1,
.vtRequestsPending = FALSE, .vtRequestsPending = FALSE,
#ifdef sun #ifdef __sun
.vtPendingNum = -1, .vtPendingNum = -1,
#endif #endif
.dontVTSwitch = FALSE, .dontVTSwitch = FALSE,

View File

@ -55,7 +55,7 @@ typedef struct {
/* event handler part */ /* event handler part */
int lastEventTime; int lastEventTime;
Bool vtRequestsPending; Bool vtRequestsPending;
#ifdef sun #ifdef __sun
int vtPendingNum; int vtPendingNum;
#endif #endif
Bool dontVTSwitch; Bool dontVTSwitch;

View File

@ -29,7 +29,7 @@
#include <xorg-config.h> #include <xorg-config.h>
#endif #endif
#if defined(_XOPEN_SOURCE) || defined(sun) && defined(__SVR4) #if defined(_XOPEN_SOURCE) || defined(__sun) && defined(__SVR4)
#include <math.h> #include <math.h>
#else #else
#define _XOPEN_SOURCE /* to get prototype for pow on some systems */ #define _XOPEN_SOURCE /* to get prototype for pow on some systems */

View File

@ -50,7 +50,7 @@
#define OSNAME "openbsd" #define OSNAME "openbsd"
#elif defined(__GNU__) #elif defined(__GNU__)
#define OSNAME "hurd" #define OSNAME "hurd"
#elif defined(SVR4) && defined(sun) #elif defined(SVR4) && defined(__sun)
#define OSNAME "solaris" #define OSNAME "solaris"
#elif defined(SVR5) #elif defined(SVR5)
#define OSNAME "svr5" #define OSNAME "svr5"

View File

@ -31,7 +31,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/mman.h> #include <sys/mman.h>
#ifdef sun #ifdef __sun
#include <sys/utsname.h> #include <sys/utsname.h>
#endif #endif
#include "xf86.h" #include "xf86.h"
@ -173,7 +173,7 @@ promIsP1275(void)
break; break;
} }
fclose(f); fclose(f);
#elif defined(sun) #elif defined(__sun)
struct utsname buffer; struct utsname buffer;
if ((uname(&buffer) >= 0) && !strcmp(buffer.machine, "sun4u")) if ((uname(&buffer) >= 0) && !strcmp(buffer.machine, "sun4u"))

View File

@ -84,7 +84,7 @@
/* SYSV386 (SVR3, SVR4), including Solaris */ /* SYSV386 (SVR3, SVR4), including Solaris */
/**************************************************************************/ /**************************************************************************/
#if (defined(SYSV) || defined(SVR4)) && \ #if (defined(SYSV) || defined(SVR4)) && \
(defined(sun) || defined(__i386__)) (defined(__sun) || defined(__i386__))
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <signal.h> #include <signal.h>
#include <termio.h> #include <termio.h>
@ -94,21 +94,21 @@
#include <errno.h> #include <errno.h>
#if defined(_NEED_SYSI86) #if defined(_NEED_SYSI86)
#if !(defined (sun) && defined (SVR4)) #if !(defined (__sun) && defined (SVR4))
#include <sys/immu.h> #include <sys/immu.h>
#include <sys/region.h> #include <sys/region.h>
#include <sys/proc.h> #include <sys/proc.h>
#endif #endif
#include <sys/tss.h> #include <sys/tss.h>
#include <sys/sysi86.h> #include <sys/sysi86.h>
#if defined(SVR4) && !defined(sun) #if defined(SVR4) && !defined(__sun)
#include <sys/seg.h> #include <sys/seg.h>
#endif /* SVR4 && !sun */ #endif /* SVR4 && !__sun */
/* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */ /* V86SC_IOPL was moved to <sys/sysi86.h> on Solaris 7 and later */
#if !defined(V86SC_IOPL) /* Solaris 7 or later? */ #if !defined(V86SC_IOPL) /* Solaris 7 or later? */
#include <sys/v86.h> /* Nope */ #include <sys/v86.h> /* Nope */
#endif #endif
#if defined(sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4) #if defined(__sun) && (defined (__i386__) || defined(__i386) || defined(__x86)) && defined (SVR4)
#include <sys/psw.h> #include <sys/psw.h>
#endif #endif
#endif /* _NEED_SYSI86 */ #endif /* _NEED_SYSI86 */
@ -122,14 +122,14 @@
#include <sys/mmap.h> /* MMAP driver header */ #include <sys/mmap.h> /* MMAP driver header */
#endif #endif
#if !defined(sun) || defined(HAVE_SYS_VT_H) #if !defined(__sun) || defined(HAVE_SYS_VT_H)
#define HAS_USL_VTS #define HAS_USL_VTS
#endif #endif
#if !defined(sun) #if !defined(__sun)
#include <sys/emap.h> #include <sys/emap.h>
#endif #endif
#if defined(HAS_USL_VTS) #if defined(HAS_USL_VTS)
#if !defined(sun) #if !defined(__sun)
#include <sys/at_ansi.h> #include <sys/at_ansi.h>
#endif #endif
#include <sys/kd.h> #include <sys/kd.h>
@ -139,7 +139,7 @@ extern _X_HIDDEN void xf86VTAcquire(int);
extern _X_HIDDEN void xf86VTRelease(int); extern _X_HIDDEN void xf86VTRelease(int);
#endif #endif
#if defined(sun) #if defined(__sun)
#include <sys/fbio.h> #include <sys/fbio.h>
extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX]; 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_NUM LED_NUM_LOCK
#define LED_SCR LED_SCROLL_LOCK #define LED_SCR LED_SCROLL_LOCK
#define LED_COMP LED_COMPOSE #define LED_COMP LED_COMPOSE
#endif /* sun */ #endif /* __sun */
#if !defined(VT_ACKACQ) #if !defined(VT_ACKACQ)
#define VT_ACKACQ 2 #define VT_ACKACQ 2
@ -164,7 +164,7 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX];
#if defined(SVR4) #if defined(SVR4)
#include <sys/mman.h> #include <sys/mman.h>
#if !(defined(sun) && defined (SVR4)) #if !(defined(__sun) && defined (SVR4))
#define DEV_MEM "/dev/pmem" #define DEV_MEM "/dev/pmem"
#endif #endif
#define CLEARDTR_SUPPORT #define CLEARDTR_SUPPORT

View File

@ -112,7 +112,7 @@ SOFTWARE.
#ifdef HAVE_GETPEERUCRED #ifdef HAVE_GETPEERUCRED
#include <ucred.h> #include <ucred.h>
#ifdef sun #ifdef __sun
#include <zone.h> #include <zone.h>
#endif #endif
#endif #endif
@ -162,7 +162,7 @@ SOFTWARE.
* Test for Solaris commented out -- TSI @ UQV 2003.06.13 * Test for Solaris commented out -- TSI @ UQV 2003.06.13
*/ */
#ifdef SIOCGLIFCONF #ifdef SIOCGLIFCONF
/* #if defined(sun) */ /* #if defined(__sun) */
#define USE_SIOCGLIFCONF #define USE_SIOCGLIFCONF
/* #endif */ /* #endif */
#endif #endif
@ -383,7 +383,7 @@ AccessUsingXdmcp(void)
LocalHostEnabled = FALSE; 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 */ /* Deal with different SIOCGIFCONF ioctl semantics on these OSs */
@ -1145,7 +1145,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec ** lccp)
if (client == NULL) if (client == NULL)
return -1; return -1;
ci = ((OsCommPtr) client->osPrivate)->trans_conn; 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 /* Most implementations can only determine peer credentials for Unix
* domain sockets - Solaris getpeerucred can work with a bit more, so * 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 * we just let it tell us if the connection type is supported or not

View File

@ -155,7 +155,7 @@ xorg_backtrace(void)
#else /* not glibc or glibc < 2.1 */ #else /* not glibc or glibc < 2.1 */
#if defined(sun) && defined(__SVR4) #if defined(__sun) && defined(__SVR4)
#define HAVE_PSTACK #define HAVE_PSTACK
#endif #endif

View File

@ -368,7 +368,7 @@ ReadRequestFromClient(ClientPtr client)
oci->size - oci->bufcnt); oci->size - oci->bufcnt);
if (result <= 0) { if (result <= 0) {
if ((result < 0) && ETEST(errno)) { if ((result < 0) && ETEST(errno)) {
#if defined(SVR4) && defined(__i386__) && !defined(sun) #if defined(SVR4) && defined(__i386__) && !defined(__sun)
if (0) if (0)
#endif #endif
{ {

View File

@ -46,7 +46,7 @@ from The Open Group.
#include <rpc/rpc.h> #include <rpc/rpc.h>
#ifdef sun #ifdef __sun
/* <rpc/auth.h> only includes this if _KERNEL is #defined... */ /* <rpc/auth.h> only includes this if _KERNEL is #defined... */
extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *);
#endif #endif

View File

@ -60,7 +60,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define LED_NUM 5 #define LED_NUM 5
#define PHYS_LEDS 0x1f #define PHYS_LEDS 0x1f
#else #else
#ifdef sun #ifdef __sun
#define LED_NUM 1 #define LED_NUM 1
#define LED_SCROLL 2 #define LED_SCROLL 2
#define LED_COMPOSE 3 #define LED_COMPOSE 3