Macro SVR4 or __SVR4 for Xorg on Solaris

During investigate Opensolaris bug 6824625(And 6728611 ) . There is a issue about macro Xorg, the Xorg  seems to be a remnant of old Imake world.  For example, in app/luit/sys.c, it always use #ifdef SVR4 as switch.  but on Solaris there is no pre-define for "SVR4", only pre-define "__SVR4". (check : CC -xdumpmacros -c dummy.c). For resolve this issue, X team support a header file <X11/Xosdefs.h>. So please include this header file in the program which need use CC or gcc pre-define macros.  In Xosdefs.h:

#ifdef sun
/\* Imake configs define SVR4 on Solaris, but cc & gcc only define __SVR4
  \* This check allows non-Imake configured programs to build correctly.
  \*/
#if defined(__SVR4) && !defined(SVR4)
#define SVR4 1
#endif
#endif
This issue also be discussed in xorg mail-list early (Some portabity issues). Alan gave the solution on Solaris.
Comments:

Post a Comment:
Comments are closed for this entry.
About

williamxue

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today