#ifndef INT64_H_
#define INT64_H_
-#define INT64_H_CVSID "$Id: int64.h,v 1.13 2006/04/12 14:54:28 ballen4705 Exp $\n"
+#define INT64_H_CVSID "$Id: int64.h,v 1.16 2006/10/29 20:35:35 chrfranke Exp $\n"
-// 64 bit integer typedefs
+// 64 bit integer typedefs and format strings
#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
+// The ISO C99 standard specifies that in C++ implementations the PRI* macros
+// from <inttypes.h> should only be defined if explicitly requested
+#define __STDC_FORMAT_MACROS 1
+#include <inttypes.h> // PRId64, PRIu64, PRIx64 (also includes <stdint.h>)
#else
#ifdef HAVE_STDINT_H
-#include <stdint.h>
+#include <stdint.h> // int64_t, uint64_t (usually included above)
#else
#ifdef HAVE_SYS_INTTYPES_H
#include <sys/inttypes.h>
#endif // HAVE_STDINT_H
#endif // HAVE_INTTYPES_H
-// 64 bit integer format strings
-
-#if defined(_WIN32) && defined(_MSC_VER)
-// for MSVC 6.0
+#ifdef _WIN32
+// for MSVCRT.DLL (used by both MSVC 6.0 and MinGW)
#define PRId64 "I64d"
#define PRIu64 "I64u"
#define PRIx64 "I64x"
-#endif // _WIN32 && _MSC_VER
+#endif // _WIN32
// If macros not defined in inttypes.h, fix here. Default is GCC
// style
-#ifndef PRId64
+#ifndef PRId64
#define PRId64 "lld"
#endif // ndef PRId64