summaryrefslogtreecommitdiff
path: root/src
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
commita683c65ad11fbb343e2235f456db9eeee467f763 (patch)
treeb02d72a618fdbd8340464fd3825e5c8dea2d5549 /src
parent30c3ecb4528eee8739d999c4fc8e86fe12950c57 (diff)
downloadhercules-a683c65ad11fbb343e2235f456db9eeee467f763.tar.gz
hercules-a683c65ad11fbb343e2235f456db9eeee467f763.tar.bz2
hercules-a683c65ad11fbb343e2235f456db9eeee467f763.tar.xz
hercules-a683c65ad11fbb343e2235f456db9eeee467f763.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/branches/renewal@14478 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-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