summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblacksirius <blacksirius@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-02 17:24:47 +0000
committerblacksirius <blacksirius@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-02 17:24:47 +0000
commita32333c07f7d82e03bca614259b97cc4ebc75f93 (patch)
tree88ef5d44d5f9c90ebc2f8e7aa9e99ae1dde26cdd
parentb351757a83313bb5ff38a31876c8a64a4a61b15a (diff)
downloadhercules-a32333c07f7d82e03bca614259b97cc4ebc75f93.tar.gz
hercules-a32333c07f7d82e03bca614259b97cc4ebc75f93.tar.bz2
hercules-a32333c07f7d82e03bca614259b97cc4ebc75f93.tar.xz
hercules-a32333c07f7d82e03bca614259b97cc4ebc75f93.zip
feature merge bs-coreoptimize->trunk: added some compiler abstractions
- forceinline -> will force the compiler to always inline the given method - ra_algin(n) -> align to (n) .. (see: http://msdn.microsoft.com/en-us/library/83ythb65(v=vs.80).aspx for more informations). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16215 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/common/cbasetypes.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h
index 58acad2c7..f36c7abf4 100644
--- a/src/common/cbasetypes.h
+++ b/src/common/cbasetypes.h
@@ -218,11 +218,19 @@ typedef uintptr_t uintptr;
#define strtoull _strtoui64
#endif
-// keyword replacement in windows
+// keyword replacement
#ifdef _WIN32
+// For MSVC (windows)
#define inline __inline
+#define forceinline __forceinline
+#define ra_align(n) __declspec(align(n))
+#else
+// For GCC
+#define forceinline __attribute__((always_inline)) inline
+#define ra_align(n) __attribute__(( aligned(n) ))
#endif
+
/////////////////////////////
// for those still not building c++
#ifndef __cplusplus