mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Common/Misc: Replace old macros with modern C++ attributes (#26613)
This commit is contained in:
@@ -23,19 +23,19 @@
|
||||
|
||||
namespace Trinity
|
||||
{
|
||||
DECLSPEC_NORETURN TC_COMMON_API void Assert(char const* file, int line, char const* function, std::string debugInfo, char const* message) ATTR_NORETURN;
|
||||
DECLSPEC_NORETURN TC_COMMON_API void Assert(char const* file, int line, char const* function, std::string debugInfo, char const* message, char const* format, ...) ATTR_NORETURN ATTR_PRINTF(6, 7);
|
||||
[[noreturn]] TC_COMMON_API void Assert(char const* file, int line, char const* function, std::string debugInfo, char const* message);
|
||||
[[noreturn]] TC_COMMON_API void Assert(char const* file, int line, char const* function, std::string debugInfo, char const* message, char const* format, ...) ATTR_PRINTF(6, 7);
|
||||
|
||||
DECLSPEC_NORETURN TC_COMMON_API void Fatal(char const* file, int line, char const* function, char const* message, ...) ATTR_NORETURN ATTR_PRINTF(4, 5);
|
||||
[[noreturn]] TC_COMMON_API void Fatal(char const* file, int line, char const* function, char const* message, ...) ATTR_PRINTF(4, 5);
|
||||
|
||||
DECLSPEC_NORETURN TC_COMMON_API void Error(char const* file, int line, char const* function, char const* message) ATTR_NORETURN;
|
||||
[[noreturn]] TC_COMMON_API void Error(char const* file, int line, char const* function, char const* message);
|
||||
|
||||
DECLSPEC_NORETURN TC_COMMON_API void Abort(char const* file, int line, char const* function) ATTR_NORETURN;
|
||||
DECLSPEC_NORETURN TC_COMMON_API void Abort(char const* file, int line, char const* function, char const* message, ...) ATTR_NORETURN;
|
||||
[[noreturn]] TC_COMMON_API void Abort(char const* file, int line, char const* function);
|
||||
[[noreturn]] TC_COMMON_API void Abort(char const* file, int line, char const* function, char const* message, ...);
|
||||
|
||||
TC_COMMON_API void Warning(char const* file, int line, char const* function, char const* message);
|
||||
|
||||
DECLSPEC_NORETURN TC_COMMON_API void AbortHandler(int sigval) ATTR_NORETURN;
|
||||
[[noreturn]] TC_COMMON_API void AbortHandler(int sigval);
|
||||
|
||||
} // namespace Trinity
|
||||
|
||||
|
||||
@@ -57,16 +57,8 @@
|
||||
#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
|
||||
# define TRINITY_PATH_MAX 260
|
||||
# define _USE_MATH_DEFINES
|
||||
# ifndef DECLSPEC_NORETURN
|
||||
# define DECLSPEC_NORETURN __declspec(noreturn)
|
||||
# endif //DECLSPEC_NORETURN
|
||||
# ifndef DECLSPEC_DEPRECATED
|
||||
# define DECLSPEC_DEPRECATED __declspec(deprecated)
|
||||
# endif //DECLSPEC_DEPRECATED
|
||||
#else // TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
|
||||
# define TRINITY_PATH_MAX PATH_MAX
|
||||
# define DECLSPEC_NORETURN
|
||||
# define DECLSPEC_DEPRECATED
|
||||
#endif // TRINITY_PLATFORM
|
||||
|
||||
#if !defined(COREDEBUG)
|
||||
@@ -79,13 +71,9 @@
|
||||
#endif //!COREDEBUG
|
||||
|
||||
#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
|
||||
# define ATTR_NORETURN __attribute__((__noreturn__))
|
||||
# define ATTR_PRINTF(F, V) __attribute__ ((__format__ (__printf__, F, V)))
|
||||
# define ATTR_DEPRECATED __attribute__((__deprecated__))
|
||||
#else //TRINITY_COMPILER != TRINITY_COMPILER_GNU
|
||||
# define ATTR_NORETURN
|
||||
# define ATTR_PRINTF(F, V)
|
||||
# define ATTR_DEPRECATED
|
||||
#endif //TRINITY_COMPILER == TRINITY_COMPILER_GNU
|
||||
|
||||
#ifdef TRINITY_API_USE_DYNAMIC_LINKING
|
||||
|
||||
Reference in New Issue
Block a user