summaryrefslogtreecommitdiff
path: root/compiler.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-11 12:50:24 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-11 12:51:06 -0700
commit687b363477a788a1353217147239484e3b02e3b2 (patch)
treec08a87a8b166250cb5550126a6771212cde71f11 /compiler.h
parent51cbf4a1fabe0f7b2604e69f3cf5228dc2cbce2b (diff)
downloadnasm-687b363477a788a1353217147239484e3b02e3b2.tar.gz
nasm-687b363477a788a1353217147239484e3b02e3b2.tar.bz2
nasm-687b363477a788a1353217147239484e3b02e3b2.zip
Define macros necessary for <inttypes.h> on C++
NASM currently doesn't compile with a C++ compiler, but the error messages are sometimes useful. Define macros necessary for <inttypes.h> to work with a C++ compiler.
Diffstat (limited to 'compiler.h')
-rw-r--r--compiler.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler.h b/compiler.h
index 3b36e97..e4e1b5b 100644
--- a/compiler.h
+++ b/compiler.h
@@ -24,6 +24,13 @@
# include "config.h"
#endif
+/* This is required to get the standard <inttypes.h> macros when compiling
+ with a C++ compiler. This must be defined *before* <inttypes.h> is
+ included, directly or indirectly. */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
+#define __STDC_FORMAT_MACROS 1
+
#ifdef __GNUC__
# if __GNUC__ >= 4
# define HAVE_GNUC_4