summaryrefslogtreecommitdiff
path: root/src/common/cbasetypes.h
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-21 13:44:10 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-21 13:44:10 +0000
commit35f0c02465492591b17dfde0e0b26411db4a5c66 (patch)
treef4172cd7c712e4fd2b29320646896b0dc6b2550c /src/common/cbasetypes.h
parentff10cb63f64792647611910a7cc463ab27a697db (diff)
downloadhercules-35f0c02465492591b17dfde0e0b26411db4a5c66.tar.gz
hercules-35f0c02465492591b17dfde0e0b26411db4a5c66.tar.bz2
hercules-35f0c02465492591b17dfde0e0b26411db4a5c66.tar.xz
hercules-35f0c02465492591b17dfde0e0b26411db4a5c66.zip
* Added msinttypes (rev. 26, http://msinttypes.googlecode.com/svn/trunk/) portability framework for Visual C++ compilers (related bugreport:4059).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14478 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/cbasetypes.h')
-rw-r--r--src/common/cbasetypes.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index 488e4db49..aee54a4bc 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -73,6 +73,11 @@
# define __attribute__(x)
#endif
+//////////////////////////////////////////////////////////////////////////
+// portable printf/scanf format macros and integer definitions
+// NOTE: Visual C++ uses <inttypes.h> and <stdint.h> provided in /3rdparty
+//////////////////////////////////////////////////////////////////////////
+#include <inttypes.h>
//////////////////////////////////////////////////////////////////////////
// typedefs to compensate type size change from 32bit to 64bit
@@ -174,22 +179,20 @@ typedef int ssize_t;
typedef __int64 int64;
typedef signed __int64 sint64;
typedef unsigned __int64 uint64;
-#define LLCONST(a) (a##i64)
#else
typedef long long int64;
typedef signed long long sint64;
typedef unsigned long long uint64;
-#define LLCONST(a) (a##ll)
#endif
#ifndef INT64_MIN
-#define INT64_MIN (LLCONST(-9223372036854775807)-1)
+#define INT64_MIN (INT64_C(-9223372036854775807)-1)
#endif
#ifndef INT64_MAX
-#define INT64_MAX (LLCONST(9223372036854775807))
+#define INT64_MAX (INT64_C(9223372036854775807))
#endif
#ifndef UINT64_MAX
-#define UINT64_MAX (LLCONST(18446744073709551615u))
+#define UINT64_MAX (UINT64_C(18446744073709551615))
#endif