diff options
Diffstat (limited to 'src/common/cbasetypes.h')
-rw-r--r-- | src/common/cbasetypes.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index d3db86543..8c3b5ad04 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2015 Hercules Dev Team + * Copyright (C) 2012-2016 Hercules Dev Team * * Hercules is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -291,12 +291,19 @@ typedef uintptr_t uintptr; #define GCC_VERSION 0 #endif -// Pragma macro only enabled on gcc >= 4.5 or clang - borrowed from Mana Plus -#if defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40500) -#define PRAGMA_GCC45(str) _Pragma(#str) -#else // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40500) -#define PRAGMA_GCC45(str) -#endif // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40500) +// Pragma macro only enabled on gcc >= 4.6 or clang - borrowed from Mana Plus +#if defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40600) +#define PRAGMA_GCC46(str) _Pragma(#str) +#else // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40600) +#define PRAGMA_GCC46(str) +#endif // ! defined(__GNUC__) && (defined(__clang__) || GCC_VERSION >= 40600) + +// fallthrough attribute only enabled on gcc >= 7.0 +#if defined(__GNUC__) && (GCC_VERSION >= 70000) +#define FALLTHROUGH __attribute__ ((fallthrough)); +#else // ! defined(__GNUC__) && (GCC_VERSION >= 70000) +#define FALLTHROUGH +#endif // ! defined(__GNUC__) && (GCC_VERSION >= 70000) // boolean types for C #if !defined(_MSC_VER) || _MSC_VER >= 1800 |