summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Globals.h')
-rw-r--r--src/Globals.h35
1 files changed, 21 insertions, 14 deletions
diff --git a/src/Globals.h b/src/Globals.h
index 1f354ae77..f0e370d2c 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -192,14 +192,13 @@ template class SizeChecker<UInt8, 1>;
#define WIN32_LEAN_AND_MEAN
#define _WIN32_WINNT _WIN32_WINNT_WS03 // We want to target Windows XP with Service Pack 2 & Windows Server 2003 with Service Pack 1 and higher
+ // Windows SDK defines min and max macros, messing up with our std::min and std::max usage
+ #define NOMINMAX
+
#include <Windows.h>
#include <winsock2.h>
#include <Ws2tcpip.h> // IPv6 stuff
- // Windows SDK defines min and max macros, messing up with our std::min and std::max usage
- #undef min
- #undef max
-
// Windows SDK defines GetFreeSpace as a constant, probably a Win16 API remnant
#ifdef GetFreeSpace
#undef GetFreeSpace
@@ -221,6 +220,7 @@ template class SizeChecker<UInt8, 1>;
#include <semaphore.h>
#include <errno.h>
#include <fcntl.h>
+ #include <unistd.h>
#endif
#if defined(ANDROID_NDK)
@@ -261,15 +261,15 @@ template class SizeChecker<UInt8, 1>;
+// Common headers (part 1, without macros):
+#include "StringUtils.h"
+#include "OSSupport/CriticalSection.h"
+#include "OSSupport/Event.h"
+#include "OSSupport/File.h"
+#include "OSSupport/StackTrace.h"
+
#ifndef TEST_GLOBALS
- // Common headers (part 1, without macros):
- #include "StringUtils.h"
- #include "OSSupport/CriticalSection.h"
- #include "OSSupport/Semaphore.h"
- #include "OSSupport/Event.h"
- #include "OSSupport/File.h"
#include "Logger.h"
- #include "OSSupport/StackTrace.h"
#else
// Logging functions
void inline LOGERROR(const char * a_Format, ...) FORMATSTRING(1, 2);
@@ -316,6 +316,9 @@ void inline LOG(const char * a_Format, ...)
va_end(argList);
}
+#define LOGINFO LOG
+#define LOGWARN LOGWARNING
+
#endif
@@ -433,10 +436,14 @@ typename std::enable_if<std::is_arithmetic<T>::value, C>::type CeilC(T a_Value)
//temporary replacement for std::make_unique until we get c++14
-template <class T, class... Args>
-std::unique_ptr<T> make_unique(Args&&... args)
+
+namespace cpp14
{
- return std::unique_ptr<T>(new T(args...));
+ template <class T, class... Args>
+ std::unique_ptr<T> make_unique(Args&&... args)
+ {
+ return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+ }
}
// a tick is 50 ms