Bug 1103 - AIX compiler error in render extension (redefined macro)
Summary: AIX compiler error in render extension (redefined macro)
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: git
Hardware: Other AIX
: high blocker
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 351
  Show dependency treegraph
 
Reported: 2004-08-16 14:43 UTC by Dan McNichol
Modified: 2004-08-17 18:43 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

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.