Bug 1103

Summary: AIX compiler error in render extension (redefined macro)
Product: xorg Reporter: Dan McNichol <mcnichol>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: high CC: kem
Version: git   
Hardware: Other   
OS: AIX   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 351    

Description Dan McNichol 2004-08-16 14:43:16 UTC
Here is the compile error I am hitting:

        rm -f renderedge.o
        xlc -c -O -D__STR31__ -DNDEBUG    -I. -I../include -I../mi -
I../../../include/fonts  -I../fb -I../hw/kdrive -I../../../include/extensions -
I../../../exports/include/X11  -I../../../include/fonts -I../Xext  -I../../.. -
I../../../exports/include   -DSYSV -DAIXV3 -DAIXV4 -DAIXV5 -D_ALL_SOURCE -
DSHAPE   -DXKB -DLBX -DXAPPGROUP -DXCSECURITY -DTOGCUP      -DDPMSExtension   -
DPIXPRIV      -DRENDER -DRANDR -DXFIXES -DDAMAGE -DCOMPOSITE -DXEVIE -
D_IBM_LFT -DNDEBUG    -DFUNCPROTO=15      renderedge.c
"renderedge.c", line 47.9: 1506-213 (S) Macro name div cannot be redefined.
"renderedge.c", line 47.9: 1506-358 (I) "div" is defined on line 634 
of /usr/include/stdlib.h.
"renderedge.c", line 59.51: 1506-068 (S) Operation between types "struct 
div_t" and "long" is not allowed.
make: The error code from the last command is 1.


Stop.







And here is a simple patch to fix the problem:

*** xc/programs/Xserver/render/renderedge.c.orig        Fri Aug  6 18:42:10 
2004
--- xc/programs/Xserver/render/renderedge.c     Mon Aug 16 10:42:56 2004
***************
*** 44,49 ****
--- 44,52 ----
      return (i | f);
  }
  
+ #ifdef div
+ #undef div
+ #endif
  #define div(a,b)    ((a) >= 0 ? (a) / (b) : -((-(a) + (b) - 1) / (b)))
  
  /*
Comment 1 Kevin E. Martin 2004-08-18 11:43:27 UTC
Redefining to _div to avoid conflict with stdlib.h on AIX.
Patch checked in.
Closing.

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.