aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/Common.h8
-rw-r--r--src/common/CompilerDefs.h34
-rw-r--r--src/common/Debugging/Errors.h2
-rw-r--r--src/common/Debugging/WheatyExceptionReport.cpp2
-rw-r--r--src/common/Debugging/WheatyExceptionReport.h2
-rw-r--r--src/common/Define.h18
-rw-r--r--src/common/GitRevision.cpp8
-rw-r--r--src/common/Logging/AppenderConsole.cpp6
-rw-r--r--src/common/Logging/AppenderFile.cpp2
-rw-r--r--src/common/Logging/Log.h2
-rw-r--r--src/common/Metric/Metric.h2
-rw-r--r--src/common/Threading/ProcessPriority.h8
-rw-r--r--src/common/Utilities/Util.cpp8
13 files changed, 50 insertions, 52 deletions
diff --git a/src/common/Common.h b/src/common/Common.h
index 9ccc0d4d149..a37111fcaf9 100644
--- a/src/common/Common.h
+++ b/src/common/Common.h
@@ -53,14 +53,14 @@
#include "Threading/LockedQueue.h"
-#if PLATFORM == PLATFORM_WINDOWS
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
# include <ws2tcpip.h>
-# if defined(__INTEL_COMPILER)
+# if TRINITY_COMPILER == TRINITY_COMPILER_INTEL
# if !defined(BOOST_ASIO_HAS_MOVE)
# define BOOST_ASIO_HAS_MOVE
# endif // !defined(BOOST_ASIO_HAS_MOVE)
-# endif // if defined(__INTEL_COMPILER)
+# endif // if TRINITY_COMPILER == TRINITY_COMPILER_INTEL
#else
# include <sys/types.h>
@@ -71,7 +71,7 @@
# include <netdb.h>
#endif
-#if COMPILER == COMPILER_MICROSOFT
+#if TRINITY_COMPILER == TRINITY_COMPILER_MICROSOFT
#include <float.h>
diff --git a/src/common/CompilerDefs.h b/src/common/CompilerDefs.h
index 10db0589539..0509dcf9177 100644
--- a/src/common/CompilerDefs.h
+++ b/src/common/CompilerDefs.h
@@ -19,37 +19,37 @@
#ifndef TRINITY_COMPILERDEFS_H
#define TRINITY_COMPILERDEFS_H
-#define PLATFORM_WINDOWS 0
-#define PLATFORM_UNIX 1
-#define PLATFORM_APPLE 2
-#define PLATFORM_INTEL 3
+#define TRINITY_PLATFORM_WINDOWS 0
+#define TRINITY_PLATFORM_UNIX 1
+#define TRINITY_PLATFORM_APPLE 2
+#define TRINITY_PLATFORM_INTEL 3
// must be first (win 64 also define _WIN32)
#if defined( _WIN64 )
-# define PLATFORM PLATFORM_WINDOWS
+# define TRINITY_PLATFORM TRINITY_PLATFORM_WINDOWS
#elif defined( __WIN32__ ) || defined( WIN32 ) || defined( _WIN32 )
-# define PLATFORM PLATFORM_WINDOWS
+# define TRINITY_PLATFORM TRINITY_PLATFORM_WINDOWS
#elif defined( __APPLE_CC__ )
-# define PLATFORM PLATFORM_APPLE
+# define TRINITY_PLATFORM TRINITY_PLATFORM_APPLE
#elif defined( __INTEL_COMPILER )
-# define PLATFORM PLATFORM_INTEL
+# define TRINITY_PLATFORM TRINITY_PLATFORM_INTEL
#else
-# define PLATFORM PLATFORM_UNIX
+# define TRINITY_PLATFORM TRINITY_PLATFORM_UNIX
#endif
-#define COMPILER_MICROSOFT 0
-#define COMPILER_GNU 1
-#define COMPILER_BORLAND 2
-#define COMPILER_INTEL 3
+#define TRINITY_COMPILER_MICROSOFT 0
+#define TRINITY_COMPILER_GNU 1
+#define TRINITY_COMPILER_BORLAND 2
+#define TRINITY_COMPILER_INTEL 3
#ifdef _MSC_VER
-# define COMPILER COMPILER_MICROSOFT
+# define TRINITY_COMPILER TRINITY_COMPILER_MICROSOFT
#elif defined( __BORLANDC__ )
-# define COMPILER COMPILER_BORLAND
+# define TRINITY_COMPILER TRINITY_COMPILER_BORLAND
#elif defined( __INTEL_COMPILER )
-# define COMPILER COMPILER_INTEL
+# define TRINITY_COMPILER TRINITY_COMPILER_INTEL
#elif defined( __GNUC__ )
-# define COMPILER COMPILER_GNU
+# define TRINITY_COMPILER TRINITY_COMPILER_GNU
# define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#else
# error "FATAL ERROR: Unknown compiler."
diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h
index bf06d77d303..c21972af906 100644
--- a/src/common/Debugging/Errors.h
+++ b/src/common/Debugging/Errors.h
@@ -38,7 +38,7 @@ namespace Trinity
} // namespace Trinity
-#if COMPILER == COMPILER_MICROSOFT
+#if TRINITY_COMPILER == TRINITY_COMPILER_MICROSOFT
#define ASSERT_BEGIN __pragma(warning(push)) __pragma(warning(disable: 4127))
#define ASSERT_END __pragma(warning(pop))
#else
diff --git a/src/common/Debugging/WheatyExceptionReport.cpp b/src/common/Debugging/WheatyExceptionReport.cpp
index 68226d9c3a6..25d768654f6 100644
--- a/src/common/Debugging/WheatyExceptionReport.cpp
+++ b/src/common/Debugging/WheatyExceptionReport.cpp
@@ -5,7 +5,7 @@
//==========================================
#include "CompilerDefs.h"
-#if PLATFORM == PLATFORM_WINDOWS && !defined(__MINGW32__)
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS && !defined(__MINGW32__)
#define WIN32_LEAN_AND_MEAN
#pragma warning(disable:4996)
#pragma warning(disable:4312)
diff --git a/src/common/Debugging/WheatyExceptionReport.h b/src/common/Debugging/WheatyExceptionReport.h
index 34919b19e01..ccb9edd7643 100644
--- a/src/common/Debugging/WheatyExceptionReport.h
+++ b/src/common/Debugging/WheatyExceptionReport.h
@@ -1,7 +1,7 @@
#ifndef _WHEATYEXCEPTIONREPORT_
#define _WHEATYEXCEPTIONREPORT_
-#if PLATFORM == PLATFORM_WINDOWS && !defined(__MINGW32__)
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS && !defined(__MINGW32__)
#include <winnt.h>
#include <winternl.h>
diff --git a/src/common/Define.h b/src/common/Define.h
index b09db7846b5..4e7cf03956e 100644
--- a/src/common/Define.h
+++ b/src/common/Define.h
@@ -21,7 +21,7 @@
#include "CompilerDefs.h"
-#if COMPILER == COMPILER_GNU
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
# if !defined(__STDC_FORMAT_MACROS)
# define __STDC_FORMAT_MACROS
# endif
@@ -55,7 +55,7 @@
# endif
#endif
-#if PLATFORM == PLATFORM_WINDOWS
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
# define TRINITY_PATH_MAX MAX_PATH
# define _USE_MATH_DEFINES
# ifndef DECLSPEC_NORETURN
@@ -64,11 +64,11 @@
# ifndef DECLSPEC_DEPRECATED
# define DECLSPEC_DEPRECATED __declspec(deprecated)
# endif //DECLSPEC_DEPRECATED
-#else //PLATFORM != PLATFORM_WINDOWS
+#else // TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
# define TRINITY_PATH_MAX PATH_MAX
# define DECLSPEC_NORETURN
# define DECLSPEC_DEPRECATED
-#endif //PLATFORM
+#endif // TRINITY_PLATFORM
#if !defined(COREDEBUG)
# define TRINITY_INLINE inline
@@ -79,21 +79,21 @@
# define TRINITY_INLINE
#endif //!COREDEBUG
-#if COMPILER == COMPILER_GNU
+#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 //COMPILER != COMPILER_GNU
+#else //TRINITY_COMPILER != TRINITY_COMPILER_GNU
# define ATTR_NORETURN
# define ATTR_PRINTF(F, V)
# define ATTR_DEPRECATED
-#endif //COMPILER == COMPILER_GNU
+#endif //TRINITY_COMPILER == TRINITY_COMPILER_GNU
#ifdef TRINITY_API_USE_DYNAMIC_LINKING
-# if COMPILER == COMPILER_MICROSOFT
+# if TRINITY_COMPILER == TRINITY_COMPILER_MICROSOFT
# define TC_API_EXPORT __declspec(dllexport)
# define TC_API_IMPORT __declspec(dllimport)
-# elif COMPILER == COMPILER_GNU
+# elif TRINITY_COMPILER == TRINITY_COMPILER_GNU
# define TC_API_EXPORT __attribute__((visibility("default")))
# define TC_API_IMPORT
# else
diff --git a/src/common/GitRevision.cpp b/src/common/GitRevision.cpp
index 1f4c28cd310..e0626a7df1d 100644
--- a/src/common/GitRevision.cpp
+++ b/src/common/GitRevision.cpp
@@ -46,17 +46,17 @@ char const* GitRevision::GetHotfixesDatabase()
return _HOTFIXES_DATABASE;
}
-#if PLATFORM == PLATFORM_WINDOWS
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
# ifdef _WIN64
# define TRINITY_PLATFORM_STR "Win64"
# else
# define TRINITY_PLATFORM_STR "Win32"
# endif
-#elif PLATFORM == PLATFORM_APPLE
+#elif TRINITY_PLATFORM == TRINITY_PLATFORM_APPLE
# define TRINITY_PLATFORM_STR "MacOSX"
-#elif PLATFORM == PLATFORM_INTEL
+#elif TRINITY_PLATFORM == TRINITY_PLATFORM_INTEL
# define TRINITY_PLATFORM_STR "Intel"
-#else // PLATFORM_UNIX
+#else // TRINITY_PLATFORM_UNIX
# define TRINITY_PLATFORM_STR "Unix"
#endif
diff --git a/src/common/Logging/AppenderConsole.cpp b/src/common/Logging/AppenderConsole.cpp
index e61cfdf30fa..3378c185cc5 100644
--- a/src/common/Logging/AppenderConsole.cpp
+++ b/src/common/Logging/AppenderConsole.cpp
@@ -21,7 +21,7 @@
#include "Config.h"
#include "Util.h"
-#if PLATFORM == PLATFORM_WINDOWS
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
#include <Windows.h>
#endif
@@ -66,7 +66,7 @@ void AppenderConsole::InitColors(std::string const& str)
void AppenderConsole::SetColor(bool stdout_stream, ColorTypes color)
{
-#if PLATFORM == PLATFORM_WINDOWS
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
static WORD WinColorFG[MaxColors] =
{
0, // BLACK
@@ -153,7 +153,7 @@ void AppenderConsole::SetColor(bool stdout_stream, ColorTypes color)
void AppenderConsole::ResetColor(bool stdout_stream)
{
- #if PLATFORM == PLATFORM_WINDOWS
+ #if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE);
SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED);
#else
diff --git a/src/common/Logging/AppenderFile.cpp b/src/common/Logging/AppenderFile.cpp
index cfd8732bd5c..a1595594a36 100644
--- a/src/common/Logging/AppenderFile.cpp
+++ b/src/common/Logging/AppenderFile.cpp
@@ -20,7 +20,7 @@
#include "StringFormat.h"
#include "Log.h"
-#if PLATFORM == PLATFORM_WINDOWS
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
# include <Windows.h>
#endif
diff --git a/src/common/Logging/Log.h b/src/common/Logging/Log.h
index a4e0cb6a5dc..218d03f804d 100644
--- a/src/common/Logging/Log.h
+++ b/src/common/Logging/Log.h
@@ -166,7 +166,7 @@ inline bool Log::ShouldLog(std::string const& type, LogLevel level) const
} \
}
-#if PLATFORM != PLATFORM_WINDOWS
+#if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
void check_args(const char*, ...) ATTR_PRINTF(1, 2);
void check_args(std::string const&, ...);
diff --git a/src/common/Metric/Metric.h b/src/common/Metric/Metric.h
index f3a852c7559..8e4d1292519 100644
--- a/src/common/Metric/Metric.h
+++ b/src/common/Metric/Metric.h
@@ -116,7 +116,7 @@ public:
#define sMetric Metric::instance()
-#if PLATFORM != PLATFORM_WINDOWS
+#if TRINITY_PLATFORM != TRINITY_PLATFORM_WINDOWS
#define TC_METRIC_EVENT(category, title, description) \
do { \
if (sMetric->IsEnabled()) \
diff --git a/src/common/Threading/ProcessPriority.h b/src/common/Threading/ProcessPriority.h
index 65332c6dff3..b4ff3f5ecf6 100644
--- a/src/common/Threading/ProcessPriority.h
+++ b/src/common/Threading/ProcessPriority.h
@@ -28,11 +28,6 @@
void SetProcessPriority(const std::string& logChannel)
{
-// Suppresses Mac OS X Warning since logChannel isn't used.
-#if PLATFORM_APPLE
- (void)logChannel;
-#endif
-
#if defined(_WIN32) || defined(__linux__)
///- Handle affinity for multiple processors and process priority
@@ -99,6 +94,9 @@ void SetProcessPriority(const std::string& logChannel)
}
#endif
+#else
+ // Suppresses unused argument warning for all other platforms
+ (void)logChannel;
#endif
}
diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp
index a3f2eb7d5a6..ae08d3ba5a6 100644
--- a/src/common/Utilities/Util.cpp
+++ b/src/common/Utilities/Util.cpp
@@ -24,7 +24,7 @@
#include <stdarg.h>
#include <boost/algorithm/string/case_conv.hpp>
-#if COMPILER == COMPILER_GNU
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -421,7 +421,7 @@ std::wstring GetMainPartOfName(std::wstring const& wname, uint32 declension)
bool utf8ToConsole(const std::string& utf8str, std::string& conStr)
{
-#if PLATFORM == PLATFORM_WINDOWS
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
std::wstring wstr;
if (!Utf8toWStr(utf8str, wstr))
return false;
@@ -438,7 +438,7 @@ bool utf8ToConsole(const std::string& utf8str, std::string& conStr)
bool consoleToUtf8(const std::string& conStr, std::string& utf8str)
{
-#if PLATFORM == PLATFORM_WINDOWS
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
std::wstring wstr;
wstr.resize(conStr.size());
OemToCharBuffW(&conStr[0], &wstr[0], uint32(conStr.size()));
@@ -477,7 +477,7 @@ void utf8printf(FILE* out, const char *str, ...)
void vutf8printf(FILE* out, const char *str, va_list* ap)
{
-#if PLATFORM == PLATFORM_WINDOWS
+#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS
char temp_buf[32 * 1024];
wchar_t wtemp_buf[32 * 1024];