]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - int64.h
Imported smartmontools-5.37.cvs20061111
[mirror_smartmontools-debian.git] / int64.h
diff --git a/int64.h b/int64.h
index 64aa28dc81aaf82541b0e546f16a9fc6d8ec2d9d..0ab1dd4a8a78c7d89aaed830d369ce039e3ab9bd 100644 (file)
--- a/int64.h
+++ b/int64.h
 #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>
@@ -56,18 +59,16 @@ typedef unsigned long long uint64_t;
 #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