[Openmp-commits] [openmp] r293468 - [libomptarget] Fix Debug build with glibc < 2.18
Jonas Hahnfeld via Openmp-commits
openmp-commits at lists.llvm.org
Mon Jan 30 00:11:21 PST 2017
Author: hahnfeld
Date: Mon Jan 30 02:11:20 2017
New Revision: 293468
URL: http://llvm.org/viewvc/llvm-project?rev=293468&view=rev
Log:
[libomptarget] Fix Debug build with glibc < 2.18
glibc < 2.18 is C99 compliant and only provides the format macros in C++ if
__STDC_FORMAT_MACROS is defined. This change fixes the debug build for
GCC 4.8, GCC 6.2 and Clang 3.9.1 that were previously broken on my machine.
It shows no regression for libc++ >= 4.0.0 which has a fix since September:
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160926/171659.html
Modified:
openmp/trunk/libomptarget/src/omptarget.h
Modified: openmp/trunk/libomptarget/src/omptarget.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/src/omptarget.h?rev=293468&r1=293467&r2=293468&view=diff
==============================================================================
--- openmp/trunk/libomptarget/src/omptarget.h (original)
+++ openmp/trunk/libomptarget/src/omptarget.h Mon Jan 30 02:11:20 2017
@@ -198,6 +198,7 @@ void __kmpc_push_target_tripcount(int32_
fprintf(stderr, __VA_ARGS__); \
}
+#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#define DPxMOD "0x%0*" PRIxPTR
#define DPxPTR(ptr) ((int)(2*sizeof(uintptr_t))), ((uintptr_t) (ptr))
More information about the Openmp-commits
mailing list