diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/cbasetypes.h | 27 | ||||
-rw-r--r-- | src/common/mmo.h | 21 |
2 files changed, 39 insertions, 9 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index 8c3b5ad04..2c36c23bc 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -109,6 +109,14 @@ # define __attribute__(x) #endif +/// Feature/extension checking macros +#ifndef __has_extension /* Available in clang and gcc >= 3 */ +#define __has_extension(x) 0 +#endif +#ifndef __has_feature /* Available in clang and gcc >= 5 */ +#define __has_feature(x) __has_extension(x) +#endif + ////////////////////////////////////////////////////////////////////////// // portable printf/scanf format macros and integer definitions // NOTE: Visual C++ uses <inttypes.h> and <stdint.h> provided in /3rdparty @@ -441,4 +449,23 @@ typedef char bool; /** Support macros for marking structs as unavailable */ #define UNAVAILABLE_STRUCT int8 HERC__unavailable_struct +/** Static assertion (only on compilers that support it) */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +// C11 version +#define STATIC_ASSERT(ex, msg) _Static_assert(ex, msg) +#elif __has_feature(c_static_assert) +// Clang support (as per http://clang.llvm.org/docs/LanguageExtensions.html) +#define STATIC_ASSERT(ex, msg) _Static_assert(ex, msg) +#elif defined(__GNUC__) && GCC_VERSION >= 40700 +// GCC >= 4.7 is known to support it +#define STATIC_ASSERT(ex, msg) _Static_assert(ex, msg) +#elif defined(_MSC_VER) +// MSVC doesn't support it, but it accepts the C++ style version +#define STATIC_ASSERT(ex, msg) static_assert(ex, msg) +#else +// Otherise just ignore it until it's supported +#define STATIC_ASSERT(ex, msg) +#endif + + #endif /* COMMON_CBASETYPES_H */ diff --git a/src/common/mmo.h b/src/common/mmo.h index 93151d3ca..9c29b8a0e 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -259,12 +259,12 @@ // The following system marks a different job ID system used by the map server, // which makes a lot more sense than the normal one. [Skotlex] // These marks the "level" of the job. -#define JOBL_2_1 0x100 //256 -#define JOBL_2_2 0x200 //512 -#define JOBL_2 0x300 -#define JOBL_UPPER 0x1000 //4096 -#define JOBL_BABY 0x2000 //8192 -#define JOBL_THIRD 0x4000 //16384 +#define JOBL_2_1 0x0100 +#define JOBL_2_2 0x0200 +#define JOBL_2 0x0300 // JOBL_2_1 | JOBL_2_2 +#define JOBL_UPPER 0x1000 +#define JOBL_BABY 0x2000 +#define JOBL_THIRD 0x4000 #define SCRIPT_VARNAME_LENGTH 32 ///< Maximum length of a script variable @@ -566,7 +566,7 @@ struct mmo_charstatus { int zeny; int bank_vault; - short class_; + int16 class; int status_point, skill_point; int hp,max_hp,sp,max_sp; unsigned int option; @@ -670,7 +670,7 @@ struct party_member { int account_id; int char_id; char name[NAME_LENGTH]; - unsigned short class_; + int16 class; unsigned short map; unsigned short lv; unsigned leader : 1, @@ -689,7 +689,9 @@ struct party { struct map_session_data; struct guild_member { int account_id, char_id; - short hair,hair_color,gender,class_,lv; + short hair,hair_color,gender; + int16 class; + short lv; uint64 exp; int exp_payper; short online,position; @@ -777,6 +779,7 @@ struct fame_list { }; enum fame_list_type { + RANKTYPE_UNKNOWN = -1, RANKTYPE_BLACKSMITH = 0, RANKTYPE_ALCHEMIST = 1, RANKTYPE_TAEKWON = 2, |