Protect against redefining macros
authormjsousa
Sat, 01 Dec 2012 11:27:48 +0000
changeset 760 d736dc9e9e51
parent 759 16050b4303a0
child 761 7b52623a2f37
Protect against redefining macros
main.hh
--- a/main.hh	Tue Nov 27 17:20:16 2012 +0000
+++ b/main.hh	Sat Dec 01 11:27:48 2012 +0000
@@ -48,8 +48,9 @@
 
 
  /* Get the definition of INT16_MAX, INT16_MIN, UINT64_MAX, INT64_MAX, INT64_MIN, ... */
-
+#ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS /* required to have UINTxx_MAX defined when including stdint.h from C++ source code. */
+#endif
 #include <stdint.h>         
 #include <limits>
 
@@ -124,7 +125,9 @@
  * e.g. uint64_t v; printf("value=%"PRIu64" !!\n", v);
  * e.g. uint64_t v; printf("value=%"PRIx64" !!\n", v);  // hexadecimal format
  */
+#ifndef __STDC_FORMAT_MACROS
 #define __STDC_FORMAT_MACROS
+#endif
 #include <inttypes.h>