summaryrefslogtreecommitdiff
path: root/src/common/cbasetypes.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-07-10 17:17:09 +0200
committerHaru <haru@dotalux.com>2014-07-11 08:47:35 +0200
commitbe75198abbd8420d25e67ee5d714422cf6c488db (patch)
treea19a8fe69e78f8bfc01cc0685b08a4fc88ca5654 /src/common/cbasetypes.h
parent68e7f53f05dd80e8b4ab9d84c9931df22a6b060c (diff)
downloadhercules-be75198abbd8420d25e67ee5d714422cf6c488db.tar.gz
hercules-be75198abbd8420d25e67ee5d714422cf6c488db.tar.bz2
hercules-be75198abbd8420d25e67ee5d714422cf6c488db.tar.xz
hercules-be75198abbd8420d25e67ee5d714422cf6c488db.zip
Removed some c++ compatibility definitions
- Neither our code nor 3rdparty code is, (or will compile as) C++, regardless of those checks. - Special thanks to panikon. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/cbasetypes.h')
-rw-r--r--src/common/cbasetypes.h36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index 42075de8e..6ca67382f 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -94,12 +94,6 @@
// portable printf/scanf format macros and integer definitions
// NOTE: Visual C++ uses <inttypes.h> and <stdint.h> provided in /3rdparty
//////////////////////////////////////////////////////////////////////////
-#ifdef __cplusplus
-#define __STDC_CONSTANT_MACROS
-#define __STDC_FORMAT_MACROS
-#define __STDC_LIMIT_MACROS
-#endif
-
#include <inttypes.h>
#include <stdint.h>
#include <limits.h>
@@ -280,11 +274,6 @@ typedef uintptr_t uintptr;
#endif
-/////////////////////////////
-// for those still not building c++
-#ifndef __cplusplus
-//////////////////////////////
-
// boolean types for C
#if !defined(_MSC_VER) || _MSC_VER >= 1800
// MSVC doesn't have stdbool.h yet as of Visual Studio 2012 (MSVC version 17.00)
@@ -302,10 +291,6 @@ typedef char bool;
#define __bool_true_false_are_defined
#endif // __bool_true_false_are_defined
-//////////////////////////////
-#endif // not __cplusplus
-//////////////////////////////
-
//////////////////////////////////////////////////////////////////////////
// macro tools
@@ -421,27 +406,6 @@ typedef char bool;
#define EXPAND_AND_QUOTE(x) QUOTE(x)
-//////////////////////////////////////////////////////////////////////////
-// Set a pointer variable to a pointer value.
-#ifdef __cplusplus
-template <typename T1, typename T2>
-void SET_POINTER(T1*&var, T2* p)
-{
- var = static_cast<T1*>(p);
-}
-template <typename T1, typename T2>
-void SET_FUNCPOINTER(T1& var, T2 p)
-{
- char ASSERT_POINTERSIZE[sizeof(T1) == sizeof(void*) && sizeof(T2) == sizeof(void*)?1:-1];// 1 if true, -1 if false
- union{ T1 out; T2 in; } tmp;// /!\ WARNING casting a pointer to a function pointer is against the C++ standard
- tmp.in = p;
- var = tmp.out;
-}
-#else
-#define SET_POINTER(var,p) ((var) = (p))
-#define SET_FUNCPOINTER(var,p) ((var) = (p))
-#endif
-
/* pointer size fix which fixes several gcc warnings */
#ifdef __64BIT__
#define h64BPTRSIZE(y) ((intptr)(y))