Add #undefs for posix source symbols when including papi.h
authordmp@rice.edu <unknown>
Thu, 24 Jun 2010 16:35:14 +0000 (16:35 +0000)
committerdmp@rice.edu <unknown>
Thu, 24 Jun 2010 16:35:14 +0000 (16:35 +0000)
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.

rts/Papi.c

index f726604..62f5d0d 100644 (file)
 #ifdef USE_PAPI /* ugly */
 
 #include <papi.h>
+/* 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"