REG_* enum name conflict with sys/ucontext.h
From derek.br...@gmail.com on February 24, 2009 09:39:38
this was PR 371339
if we build a client that includes ucontext.h, usually via signal.h, with g++ we hit a name conflict:
g++ -m32 -g3 -DLINUX -DSHOW_RESULTS -DX86_32 -fPIC -shared -nostartfiles -I/work/opensource/dr/exports/include signal.c -o signal.so In file included from /usr/include/signal.h:353, from signal.c:40: /usr/include/sys/ucontext.h:168: error: conflicting declaration ‘REG_EDI’ /work/opensource/dr/exports/include/dr_ir_opnd.h:73: error: ‘REG_EDI’ has a previous declaration as ‘ REG_EDI’ /usr/include/sys/ucontext.h:170: error: conflicting declaration ‘REG_ESI’ /work/opensource/dr/exports/include/dr_ir_opnd.h:72: error: ‘REG_ESI’ has a previous declaration as ‘ REG_ESI’ /usr/include/sys/ucontext.h:172: error: conflicting declaration ‘REG_EBP’ /work/opensource/dr/exports/include/dr_ir_opnd.h:71: error: ‘REG_EBP’ has a previous declaration as ‘ REG_EBP’ /usr/include/sys/ucontext.h:174: error: conflicting declaration ‘REG_ESP’ /work/opensource/dr/exports/include/dr_ir_opnd.h:70: error: ‘REG_ESP’ has a previous declaration as ‘ REG_ESP’ /usr/include/sys/ucontext.h:176: error: conflicting declaration ‘REG_EBX’ /work/opensource/dr/exports/include/dr_ir_opnd.h:69: error: ‘REG_EBX’ has a previous declaration as ‘ REG_EBX’ /usr/include/sys/ucontext.h:178: error: conflicting declaration ‘REG_EDX’ /work/opensource/dr/exports/include/dr_ir_opnd.h:68: error: ‘REG_EDX’ has a previous declaration as ‘ REG_EDX’ /usr/include/sys/ucontext.h:180: error: conflicting declaration ‘REG_ECX’ /work/opensource/dr/exports/include/dr_ir_opnd.h:67: error: ‘REG_ECX’ has a previous declaration as ‘ REG_ECX’ /usr/include/sys/ucontext.h:182: error: conflicting declaration ‘REG_EAX’ /work/opensource/dr/exports/include/dr_ir_opnd.h:66: error: ‘REG_EAX’ has a previous declaration as ‘ REG_EAX’
we hit the same conflict in the core if we build with gcc with _GNU_SOURCE defined
not clear how to solve w/o renaming our enums, which would break many existing clients
Original issue: http://code.google.com/p/dynamorio/issues/detail?id=34