From: dmp@rice.edu Date: Thu, 24 Jun 2010 16:35:14 +0000 (+0000) Subject: Add #undefs for posix source symbols when including papi.h X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=a8f29216ea1f681b89fa4f55e00e404c6b0b2417 Add #undefs for posix source symbols when including papi.h Validation fails when validating with PAPI support (i.e. GhcRtsWithPapi = YES in validate.mk). The problem is that the posix symbols are defined by a header included from papi.h. Compilation then fails because these symbols are redefined in PosixSource.h. This patch adds an undefine for the posix symbols after including papi.h and before including PosixSource.h. The #undefines are localized to Papi.c since that is the only case where they are getting defined twice. --- diff --git a/rts/Papi.c b/rts/Papi.c index f726604..62f5d0d 100644 --- a/rts/Papi.c +++ b/rts/Papi.c @@ -15,6 +15,11 @@ #ifdef USE_PAPI /* ugly */ #include +/* The posix symbols get defined in a header included from papi.h. + * undefind them here to allow redefinition in PosixSource.h */ +#undef _POSIX_SOURCE +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE #include "PosixSource.h" #include "Rts.h"