Bug 7458 - AIX changes to Xmd.h
Summary: AIX changes to Xmd.h
Alias: None
Product: xorg
Classification: Unclassified
Component: Protocol/Core (show other bugs)
Version: 7.1 (2006.05)
Hardware: Other AIX
: medium normal
Assignee: Xorg Project Team
QA Contact:
Keywords: patch
Depends on:
Reported: 2006-07-07 09:00 UTC by Dan McNichol
Modified: 2006-07-14 18:00 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

proposed AIX changes to Xmd.h (734 bytes, patch)
2006-07-10 12:45 UTC, Dan McNichol
no flags Details | Splinter Review

Description Dan McNichol 2006-07-07 09:00:07 UTC
Some AIX specific changes to Xmd.h for X11R7.1.

First the char datatype on AIX is unsigned by default and the check for AIX is
*** 139,145 ****
  typedef short INT16;
! #if defined(__STDC__) || defined(sgi) || defined(AIXV3)
  typedef signed char    INT8;
  typedef char           INT8;
--- 139,145 ----
  typedef short INT16;
! #if defined(__STDC__) || defined(sgi) || defined(_AIX)
  typedef signed char    INT8;
  typedef char           INT8;

I really want to get away from using _AIX, but __STDC__ is not defined for
all our compilers.  Other suggestions here are certainly welcome.

Next, even when compiled in 32-bit mode some of our ddx code needs the
CARD64 data type defined.

*** 150,155 ****
--- 150,158 ----
  typedef unsigned int CARD32;
  typedef unsigned long CARD32;
+ #endif
+ #if !defined(WORD64) && !defined(LONG64)
+ typedef unsigned long long CARD64;
  typedef unsigned short CARD16;
  typedef unsigned char  CARD8;
Comment 1 Erik Andren 2006-07-08 10:48:48 UTC
Please attach your suggested changes as an attachment to the bug.
Comment 2 Dan McNichol 2006-07-10 12:45:55 UTC
Created attachment 6179 [details] [review]
proposed AIX changes to Xmd.h
Comment 3 Alan Coopersmith 2006-07-10 15:44:08 UTC
Adding "unsigned long long" could break some old non-C99 compilers, but it was
such a common extension even before C99, I'm not sure it's worth the effort to
add some sort of test until it breaks something.    (And putting it in configure
in Xorg wouldn't help people using it in drivers, but the #ifdef list for all the
compilers that support it would be very long, so just adding more !defined()
clauses to the the #if case in the patch for compilers known to be broken by it
would probably be the sanest way of handling them.)
Comment 4 Alan Coopersmith 2006-07-14 18:00:53 UTC
Since no one has objected, I've gone ahead and committed to git head:

commit 0b76eb310307cd16e55d0c0792b54a2c6774fb88
Author: Dan McNichol <mcnichol@austin.ibm.com>
Date:   Fri Jul 14 17:53:34 2006 -0700

    Bug #7458: AIX changes to Xmd.h
    Bugzilla Bug #7458 <https://bugs.freedesktop.org/show_bug.cgi?id=7458>
    Patch #6179 <https://bugs.freedesktop.org/attachment.cgi?id=6179>

 Xmd.h       |    5 +++-

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.