[PATCH] Replace 'sun' with '__sun'

Richard PALO richard at netbsd.org
Mon Nov 16 22:02:27 PST 2015


From: Richard PALO <richard at NetBSD.org>

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 at NetBSD.org>
---
 Xtrans.c     | 12 ++++++------
 Xtransint.h  |  4 ++--
 Xtranslcl.c  | 32 ++++++++++++++++----------------
 Xtranssock.c |  2 +-
 4 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/Xtrans.c b/Xtrans.c
index bfba1ad..19b1828 100644
--- a/Xtrans.c
+++ b/Xtrans.c
@@ -100,15 +100,15 @@ Xtransport_table Xtransports[] = {
 #endif /* UNIXCONN */
 #if defined(LOCALCONN)
     { &TRANS(LocalFuncs),	TRANS_LOCAL_LOCAL_INDEX },
-#ifndef sun
+#ifndef __sun
     { &TRANS(PTSFuncs),		TRANS_LOCAL_PTS_INDEX },
-#endif /* sun */
+#endif /* __sun */
 #if defined(SVR4) || defined(__SVR4)
     { &TRANS(NAMEDFuncs),	TRANS_LOCAL_NAMED_INDEX },
 #endif
-#ifdef sun
+#ifdef __sun
     { &TRANS(PIPEFuncs),	TRANS_LOCAL_PIPE_INDEX },
-#endif /* sun */
+#endif /* __sun */
 #if defined(__SCO__) || defined(__UNIXWARE__)
     { &TRANS(SCOFuncs),		TRANS_LOCAL_SCO_INDEX },
 #endif /* __SCO__ || __UNIXWARE__ */
@@ -1415,7 +1415,7 @@ TRANS(MakeAllCLTSServerListeners) (const char *port, int *partial,
  */
 
 
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(__sun) || defined(WIN32)
 
 /*
  * emulate readv
@@ -1447,7 +1447,7 @@ static int TRANS(ReadV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt)
 
 #endif /* SYSV && __i386__ || WIN32 || __sxg__ */
 
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(__sun) || defined(WIN32)
 
 /*
  * emulate writev
diff --git a/Xtransint.h b/Xtransint.h
index 5ff824d..c46596f 100644
--- a/Xtransint.h
+++ b/Xtransint.h
@@ -350,7 +350,7 @@ typedef struct _Xtransport_table {
  * systems, so they may be emulated.
  */
 
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(__sun) || defined(WIN32)
 
 #define READV(ciptr, iov, iovcnt)	TRANS(ReadV)(ciptr, iov, iovcnt)
 
@@ -367,7 +367,7 @@ static	int TRANS(ReadV)(
 #endif /* CRAY || (SYSV && __i386__) || WIN32 || __sxg__ || */
 
 
-#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32)
+#if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(__sun) || defined(WIN32)
 
 #define WRITEV(ciptr, iov, iovcnt)	TRANS(WriteV)(ciptr, iov, iovcnt)
 
diff --git a/Xtranslcl.c b/Xtranslcl.c
index 3217506..a8bbf10 100644
--- a/Xtranslcl.c
+++ b/Xtranslcl.c
@@ -78,7 +78,7 @@ from The Open Group.
 #if defined(SVR4) || defined(__SVR4)
 #include <sys/filio.h>
 #endif
-#ifdef sun
+#ifdef __sun
 # include <stropts.h>
 #else
 # include <sys/stropts.h>
@@ -104,7 +104,7 @@ from The Open Group.
  *  - named pipes
  *  - SCO
  */
-#if !defined(sun)
+#if !defined(__sun)
 # define LOCAL_TRANS_PTS
 #endif
 #if defined(SVR4) || defined(__SVR4)
@@ -243,7 +243,7 @@ static void _dummy(int sig _X_UNUSED)
 }
 #endif /* LOCAL_TRANS_PTS */
 
-#ifndef sun
+#ifndef __sun
 #define X_STREAMS_DIR	"/dev/X"
 #define DEV_SPX		"/dev/spx"
 #else
@@ -259,17 +259,17 @@ static void _dummy(int sig _X_UNUSED)
 #if defined(X11_t)
 
 #define PTSNODENAME "/dev/X/server."
-#ifdef sun
+#ifdef __sun
 #define NAMEDNODENAME "/tmp/.X11-pipe/X"
 #else
 #define NAMEDNODENAME "/dev/X/Nserver."
 
 #define SCORNODENAME	"/dev/X%1sR"
 #define SCOSNODENAME	"/dev/X%1sS"
-#endif /* !sun */
+#endif /* !__sun */
 #endif
 #if defined(XIM_t)
-#ifdef sun
+#ifdef __sun
 #define NAMEDNODENAME "/tmp/.XIM-pipe/XIM"
 #else
 #define PTSNODENAME	"/dev/X/XIM."
@@ -279,7 +279,7 @@ static void _dummy(int sig _X_UNUSED)
 #endif
 #endif
 #if defined(FS_t) || defined (FONT_t)
-#ifdef sun
+#ifdef __sun
 #define NAMEDNODENAME	"/tmp/.font-pipe/fs"
 #else
 /*
@@ -293,7 +293,7 @@ static void _dummy(int sig _X_UNUSED)
 #endif
 #endif
 #if defined(ICE_t)
-#ifdef sun
+#ifdef __sun
 #define NAMEDNODENAME	"/tmp/.ICE-pipe/"
 #else
 #define PTSNODENAME	"/dev/X/ICE."
@@ -303,7 +303,7 @@ static void _dummy(int sig _X_UNUSED)
 #endif
 #endif
 #if defined(TEST_t)
-#ifdef sun
+#ifdef __sun
 #define NAMEDNODENAME	"/tmp/.Test-unix/test"
 #endif
 #define PTSNODENAME	"/dev/X/transtest."
@@ -678,7 +678,7 @@ TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, const char *port)
     int			fd;
     char		server_path[64];
     struct stat		filestat;
-# ifndef sun
+# ifndef __sun
     extern int		isastream(int);
 # endif
 #endif
@@ -1610,7 +1610,7 @@ static LOCALtrans2dev LOCALtrans2devtab[] = {
 #endif /* TRANS_SERVER */
 },
 
-#ifdef sun /* Alias "pipe" to named, since that's what Solaris called it */
+#ifdef __sun /* Alias "pipe" to named, since that's what Solaris called it */
 {"pipe",
 #ifdef TRANS_CLIENT
      TRANS(NAMEDOpenClient),
@@ -1633,7 +1633,7 @@ static LOCALtrans2dev LOCALtrans2devtab[] = {
      TRANS(NAMEDAccept)
 #endif /* TRANS_SERVER */
 },
-#endif /* sun */
+#endif /* __sun */
 #endif /* LOCAL_TRANS_NAMED */
 
 
@@ -1673,7 +1673,7 @@ static	char	*freeXLOCAL=NULL;
 #define DEF_XLOCAL "SCO:UNIX:PTS"
 #elif defined(__UNIXWARE__)
 #define DEF_XLOCAL "UNIX:PTS:NAMED:SCO"
-#elif defined(sun)
+#elif defined(__sun)
 #define DEF_XLOCAL "UNIX:NAMED"
 #else
 #define DEF_XLOCAL "UNIX:PTS:NAMED:SCO"
@@ -2345,7 +2345,7 @@ static const char * local_aliases[] = {
                                   "pts",
 # endif
 				  "named",
-# ifdef sun
+# ifdef __sun
 				  "pipe", /* compatibility with Solaris Xlib */
 # endif
 # ifdef LOCAL_TRANS_SCO
@@ -2492,7 +2492,7 @@ Xtransport	TRANS(NAMEDFuncs) = {
 	TRANS(LocalCloseForCloning),
 };
 
-#ifdef sun
+#ifdef __sun
 Xtransport	TRANS(PIPEFuncs) = {
 	/* Local Interface */
 	"pipe",
@@ -2536,7 +2536,7 @@ Xtransport	TRANS(PIPEFuncs) = {
 	TRANS(LocalClose),
 	TRANS(LocalCloseForCloning),
 };
-#endif /* sun */
+#endif /* __sun */
 #endif /* LOCAL_TRANS_NAMED */
 
 
diff --git a/Xtranssock.c b/Xtranssock.c
index d830e7c..b915380 100644
--- a/Xtranssock.c
+++ b/Xtranssock.c
@@ -112,7 +112,7 @@ from the copyright holders.
 #include <sys/filio.h>
 #endif
 
-#if (defined(__i386__) && defined(SYSV)) && !defined(SCO325) && !defined(sun)
+#if (defined(__i386__) && defined(SYSV)) && !defined(SCO325) && !defined(__sun)
 #include <net/errno.h>
 #endif
 
-- 
2.6.3





More information about the xorg-devel mailing list