[PATCH:libXt] unifdef -U__UNIXOS2__

Peter Hutterer peter.hutterer at who-t.net
Sun Jan 6 17:58:56 PST 2013


On Fri, Jan 04, 2013 at 07:54:28PM -0800, Alan Coopersmith wrote:
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
   Peter

> ---
>  src/Converters.c |   13 -------------
>  src/Display.c    |    7 -------
>  src/Intrinsic.c  |   31 ++-----------------------------
>  src/NextEvent.c  |    3 ---
>  src/TMparse.c    |   15 +--------------
>  src/Vendor.c     |   20 +-------------------
>  src/sharedlib.c  |    2 +-
>  7 files changed, 5 insertions(+), 86 deletions(-)
> 
> diff --git a/src/Converters.c b/src/Converters.c
> index 7649802..8c8d8be 100644
> --- a/src/Converters.c
> +++ b/src/Converters.c
> @@ -83,13 +83,8 @@ in this Software without prior written authorization from The Open Group.
>  #include	<X11/Xlocale.h>
>  #include	<errno.h>	/* for StringToDirectoryString */
>  
> -#ifdef __UNIXOS2__
> -#define IsNewline(str) ((str) == '\n' || (str) == '\r')
> -#define IsWhitespace(str) ((str)== ' ' || (str) == '\t' || (str) == '\r')
> -#else
>  #define IsNewline(str) ((str) == '\n')
>  #define IsWhitespace(str) ((str)== ' ' || (str) == '\t')
> -#endif
>  
>  static const String XtNwrongParameters = "wrongParameters";
>  static const String XtNconversionError = "conversionError";
> @@ -122,11 +117,7 @@ static XrmQuark  XtQGravity;
>  static XrmQuark  XtQInt;
>  static XrmQuark  XtQPixel;
>  static XrmQuark  XtQPosition;
> -#ifdef __UNIXOS2__
> -XrmQuark  _XtQString = 0;
> -#else
>  XrmQuark  _XtQString;
> -#endif
>  
>  void _XtConvertInitialize(void)
>  {
> @@ -270,11 +261,7 @@ static Boolean IsInteger(
>      int val = 0;
>      char ch;
>      /* skip leading whitespace */
> -#ifndef __UNIXOS2__
>      while ((ch = *string) == ' ' || ch == '\t') string++;
> -#else
> -    while ((ch = *string) == ' ' || ch == '\t' || ch == '\r') string++;
> -#endif
>      while ((ch = *string++)) {
>  	if (ch >= '0' && ch <= '9') {
>  	    val *= 10;
> diff --git a/src/Display.c b/src/Display.c
> index 4ccf079..0971735 100644
> --- a/src/Display.c
> +++ b/src/Display.c
> @@ -274,13 +274,6 @@ Display *XtOpenDisplay(
>  #else
>  		char *ptr = strrchr(argv[0], '/');
>  #endif
> -#ifdef __UNIXOS2__
> -		char *dot_ptr,*ptr2;
> -		ptr2 = strrchr(argv[0],'\\');
> -		if (ptr2 > ptr) ptr = ptr2;
> -		dot_ptr = strrchr(argv[0],'.');
> -		if (dot_ptr && (dot_ptr > ptr)) *dot_ptr='\0';
> -#endif  /* This will remove the .exe suffix under OS/2 */
>  
>  		if (ptr) applName = ++ptr;
>  		else applName = argv[0];
> diff --git a/src/Intrinsic.c b/src/Intrinsic.c
> index 3df0358..29bf716 100644
> --- a/src/Intrinsic.c
> +++ b/src/Intrinsic.c
> @@ -888,10 +888,6 @@ static int AccessFile (
>  
>      /* try the places set in the environment */
>      drive = getenv ("_XBASEDRIVE");
> -#ifdef __UNIXOS2__
> -    if (!drive)
> -	drive = getenv ("X11ROOT");
> -#endif
>      if (!drive)
>  	drive = "C:";
>      len = strlen (drive) + strlen (path);
> @@ -903,7 +899,6 @@ static int AccessFile (
>  	return 1;
>      }
>  
> -#ifndef __UNIXOS2__
>      /* one last place to look */
>      drive = getenv ("HOMEDRIVE");
>      if (drive) {
> @@ -936,7 +931,6 @@ static int AccessFile (
>  	    }
>  	}
>      }
> -#endif
>      return 0;
>  }
>  #endif
> @@ -1092,21 +1086,12 @@ String XtFindFile(
>  		continue;
>  	    }
>  	    if (*colon == ':')
> -#ifdef __UNIXOS2__
> -	      if (colon > (path+1))
> -#endif
>  		break;
>  	}
>  	len = colon - path;
>  	if (Resolve(path, len, substitutions, num_substitutions,
>  		    buf, '/')) {
>  	    if (firstTime || strcmp(buf1,buf2) != 0) {
> -#ifdef __UNIXOS2__
> -		{
> -			char *bufx = (char*)__XOS2RedirRoot(buf);
> -			strcpy(buf,bufx);
> -		}
> -#endif
>  #ifdef XNL_DEBUG
>  		printf("Testing file %s\n", buf);
>  #endif /* XNL_DEBUG */
> @@ -1149,7 +1134,7 @@ static char *ExtractLocaleName(
>      String	lang)
>  {
>  
> -#if defined(hpux) || defined(CSRG_BASED) || defined(sun) || defined(SVR4) || defined(sgi) || defined(__osf__) || defined(AIXV3) || defined(ultrix) || defined(WIN32) || defined(__UNIXOS2__) || defined (linux)
> +#if defined(hpux) || defined(CSRG_BASED) || defined(sun) || defined(SVR4) || defined(sgi) || defined(__osf__) || defined(AIXV3) || defined(ultrix) || defined(WIN32) || defined (linux)
>  # ifdef hpux
>  /*
>   * We need to discriminated between HPUX 9 and HPUX 10. The equivalent
> @@ -1171,7 +1156,7 @@ static char *ExtractLocaleName(
>  #   define STARTCHAR '\001'
>  #   define ENDCHAR '\001'
>  #  else
> -#   if defined(WIN32) || defined(__UNIXOS2__)
> +#   ifdef WIN32
>  #    define SKIPCOUNT 1
>  #    define STARTCHAR '='
>  #    define ENDCHAR ';'
> @@ -1327,18 +1312,6 @@ static const char *implementation_default_path(void)
>      static char xfilesearchpath[] = "";
>  
>      return xfilesearchpath;
> -#elif defined(__UNIXOS2__)
> -    /* if you know how to pass % thru the compiler let me know */
> -    static char xfilesearchpath[] = XFILESEARCHPATHDEFAULT;
> -    static Bool fixed;
> -    char *ch;
> -
> -    if (!fixed) {
> -	for (ch = xfilesearchpath; ch = strchr(ch, ';'); ch++)
> -	    *ch = '%';
> -	fixed = True;
> -    }
> -    return xfilesearchpath;
>  #else
>      return XFILESEARCHPATHDEFAULT;
>  #endif
> diff --git a/src/NextEvent.c b/src/NextEvent.c
> index b1f7bc7..4f2dcfb 100644
> --- a/src/NextEvent.c
> +++ b/src/NextEvent.c
> @@ -75,9 +75,6 @@ in this Software without prior written authorization from The Open Group.
>  #include <stdio.h>
>  #include <errno.h>
>  
> -#ifdef __UNIXOS2__
> -#include <sys/time.h>
> -#endif
>  
>  static TimerEventRec* freeTimerRecs;
>  static WorkProcRec* freeWorkRecs;
> diff --git a/src/TMparse.c b/src/TMparse.c
> index 5594cad..83b39d5 100644
> --- a/src/TMparse.c
> +++ b/src/TMparse.c
> @@ -380,11 +380,7 @@ static EventKey events[] = {
>  
>  };
>  
> -#ifndef __UNIXOS2__
>  #define IsNewline(str) ((str) == '\n')
> -#else
> -#define IsNewline(str) ((str) == '\n' || (str) == '\r')
> -#endif
>  
>  #define ScanFor(str, ch) \
>      while ((*(str) != (ch)) && (*(str) != '\0') && !IsNewline(*(str))) (str)++
> @@ -396,13 +392,8 @@ static EventKey events[] = {
>             ('a' <= *(str) && *(str) <= 'z') || \
>             ('0' <= *(str) && *(str) <= '9')) (str)++
>  
> -#ifndef __UNIXOS2__
>  #define ScanWhitespace(str) \
>      while (*(str) == ' ' || *(str) == '\t') (str)++
> -#else
> -#define ScanWhitespace(str) \
> -    while (*(str) == ' ' || *(str) == '\t' || *(str) == '\r') (str)++
> -#endif
>  
>  static Boolean initialized = FALSE;
>  static XrmQuark QMeta;
> @@ -1811,11 +1802,7 @@ static void ShowProduction(
>      size_t len;
>      char *eol, *production, productionbuf[500];
>  
> -#ifdef __UNIXOS2__
> -    eol = strchr(currentProduction, '\r');
> -    if (!eol) /* try '\n' as well below */
> -#endif
> -        eol = strchr(currentProduction, '\n');
> +    eol = strchr(currentProduction, '\n');
>      if (eol) len = eol - currentProduction;
>      else len = strlen (currentProduction);
>      production = XtStackAlloc (len + 1, productionbuf);
> diff --git a/src/Vendor.c b/src/Vendor.c
> index 26767b7..da40e07 100644
> --- a/src/Vendor.c
> +++ b/src/Vendor.c
> @@ -64,27 +64,10 @@ SOFTWARE.
>   *
>   ***************************************************************************/
>  
> -#if defined(__UNIXOS2__) || defined(__CYGWIN__) || defined(__MINGW32__)
> +#if defined(__CYGWIN__) || defined(__MINGW32__)
>  /* to fix the EditRes problem because of wrong linker semantics */
>  extern WidgetClass vendorShellWidgetClass;
>  
> -#if defined(__UNIXOS2__)
> -unsigned long _DLL_InitTerm(unsigned long mod,unsigned long flag)
> -{
> -        switch (flag) {
> -        case 0: /*called on init*/
> -                _CRT_init();
> -                vendorShellWidgetClass = (WidgetClass)(&vendorShellClassRec);
> -                return 1;
> -        case 1: /*called on exit*/
> -                return 1;
> -        default:
> -                return 0;
> -        }
> -}
> -#endif
> -
> -#if defined(__CYGWIN__) || defined(__MINGW32__)
>  int __stdcall
>  DllMain(unsigned long mod_handle, unsigned long flag, void *routine)
>  {
> @@ -99,7 +82,6 @@ DllMain(unsigned long mod_handle, unsigned long flag, void *routine)
>    return 1;
>  }
>  #endif
> -#endif
>  
>  externaldef(vendorshellclassrec) VendorShellClassRec vendorShellClassRec = {
>    {
> diff --git a/src/sharedlib.c b/src/sharedlib.c
> index 7aefc23..52138e8 100644
> --- a/src/sharedlib.c
> +++ b/src/sharedlib.c
> @@ -35,7 +35,7 @@ in this Software without prior written authorization from The Open Group.
>  #include "CreateI.h"
>  
>  
> -#if defined(AIXSHLIB) || defined(__UNIXOS2__)
> +#if defined(AIXSHLIB)
>  WidgetClass vendorShellWidgetClass = (WidgetClass) &vendorShellClassRec;
>  
>  static void _XtVendorInitialize()
> -- 
> 1.7.9.2
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list