Bug 3158 - X_NOT_STDC_ENV should not be defined on Solaris x86
Summary: X_NOT_STDC_ENV should not be defined on Solaris x86
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: * Other (show other bugs)
Version: git
Hardware: All Solaris
: high normal
Assignee: Alan Coopersmith
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-28 14:57 UTC by Alan Coopersmith
Modified: 2005-04-27 22:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch to not define X_NOT_STDC_ENV on Solaris x86 (858 bytes, patch)
2005-04-28 15:01 UTC, Alan Coopersmith
alan.coopersmith: 6.8-branch?
Details | Splinter Review

Description Alan Coopersmith 2005-04-28 14:57:39 UTC
Currently X_NOT_STDC_ENV in Xosdefs.h is defined as long if the platform 
is SYSV on i386, but not ISC, SCO or _SEQUENT_:

#ifdef i386
#ifdef SYSV
#if !defined(ISC) && !defined(SCO) && !defined(_SEQUENT_) && !defined(sun)
#if !defined(_POSIX_SOURCE) && !defined(_SCO_DS)
#define X_NOT_POSIX
#endif
#define X_NOT_STDC_ENV
#endif
#endif

This causes X_WCHAR to be defined, which in turn causes wchar_t to be
defined to unsigned long in Xlib.h:
#ifdef X_NOT_STDC_ENV
#ifndef SCO324
#ifndef ISC
#define X_WCHAR
#endif
#endif
#endif
#endif

#ifndef X_WCHAR
#include <stddef.h>
#else
#ifdef __UNIXOS2__
#include <stdlib.h>
#else
/* replace this with #include or typedef appropriate for your system */
typedef unsigned long wchar_t;
#endif
#endif

This conflicts with the definition in the Solaris system headers.   The fix is
to not define X_NOT_STDC_ENV on Solaris, since Solaris is compliant with the C89
standard.

[This bug originally reported as Sun bug 6251577 - found & fixed by Henry Zhao.]
Comment 1 Alan Coopersmith 2005-04-28 15:01:09 UTC
Created attachment 2588 [details] [review]
Patch to not define X_NOT_STDC_ENV on Solaris x86
Comment 2 Alan Coopersmith 2005-04-28 15:06:20 UTC
Fix committed to CVS head:

CVSROOT:	/cvs/xorg
Module name:	xc
Changes by:	alanc@gabe.freedesktop.org	05/04/28 15:04:12

Log message:
  2005-04-28  Alan Coopersmith  <alan.coopersmith@sun.com>
  
  	* include/Xosdefs.h:
  	Don't define X_NOT_STDC_ENV on Solaris x86.
  	Bugzilla #3158: https://bugs.freedesktop.org/show_bug.cgi?id=3158
  	Patch #2588: https://bugs.freedesktop.org/attachment.cgi?id=2588
  	(Henry Zhao, Sun Microsystems)

Modified files:
      ./:
        ChangeLog 
      xc/include/:
        Xosdefs.h 
  
  Revision      Changes    Path
  1.906         +8 -0      xc/ChangeLog
  1.3           +2 -2      xc/include/Xosdefs.h


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.