Skip to content

Commit

Permalink
Fix some preprocessor warnings on Solaris.
Browse files Browse the repository at this point in the history
Solaris is doing it wrong and polluting the global namespace
with register defines because the standard C/POSIX headers end
up including regset.h.
  • Loading branch information
alexrp committed Sep 13, 2012
1 parent 4ccf427 commit 70f8cc0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/backend/code_x86.h
Expand Up @@ -46,6 +46,11 @@ enum // #defining R12-R15 interfere with setjmps' _JUMP_BUFFER members
/* There are also XMM8..XMM14 */
#define XMM15 31

/* See Solaris note in optabgen.c */
#ifdef ES
#undef ES
#endif

#define ES 24

#define NUMGENREGS 16
Expand Down
18 changes: 18 additions & 0 deletions src/backend/optabgen.c
Expand Up @@ -724,9 +724,27 @@ void fltables()
#endif

/* Segment registers */
/* The #undefs are to appease the compiler on Solaris because
it, for some reason, ends up including regset.h in standard
C/POSIX headers, polluting the global namespace */
#ifdef ES
#undef ES
#endif
#define ES 0

#ifdef CS
#undef CS
#endif
#define CS 1

#ifdef SS
#undef SS
#endif
#define SS 2

#ifdef DS
#undef DS
#endif
#define DS 3

for (i = 0; i < FLMAX; i++)
Expand Down

0 comments on commit 70f8cc0

Please sign in to comment.