aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/common/common_funcs.h
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner <yuriks@yuriks.net>2015-05-06 23:13:27 -0300
committerGravatar Yuri Kunde Schlesner <yuriks@yuriks.net>2015-05-07 15:45:20 -0300
commita594fdb66e70f6dd45ed8ed1a0969262b0529395 (patch)
tree2006c73f5c59596fb83da9666a698355c5d75d84 /src/common/common_funcs.h
parentf3c096951be57a02467bfda74ab539e69b2eff5e (diff)
Common: Remove more unused compatibility defines
Diffstat (limited to 'src/common/common_funcs.h')
-rw-r--r--src/common/common_funcs.h45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index 56ae791d..973d8354 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -7,13 +7,6 @@
#include "common_types.h"
#include <cstdlib>
-#ifdef _WIN32
-#define SLEEP(x) Sleep(x)
-#else
-#include <unistd.h>
-#define SLEEP(x) usleep(x*1000)
-#endif
-
#define b2(x) ( (x) | ( (x) >> 1) )
#define b4(x) ( b2(x) | ( b2(x) >> 2) )
@@ -73,49 +66,11 @@ inline u64 _rotr64(u64 x, unsigned int shift){
}
#else // _MSC_VER
- #include <locale.h>
-
// Function Cross-Compatibility
#define snprintf _snprintf
// Locale Cross-Compatibility
#define locale_t _locale_t
- #define freelocale _free_locale
- #define newlocale(mask, locale, base) _create_locale(mask, locale)
-
- #define LC_GLOBAL_LOCALE ((locale_t)-1)
- #define LC_ALL_MASK LC_ALL
- #define LC_COLLATE_MASK LC_COLLATE
- #define LC_CTYPE_MASK LC_CTYPE
- #define LC_MONETARY_MASK LC_MONETARY
- #define LC_NUMERIC_MASK LC_NUMERIC
- #define LC_TIME_MASK LC_TIME
-
- inline locale_t uselocale(locale_t new_locale)
- {
- // Retrieve the current per thread locale setting
- bool bIsPerThread = (_configthreadlocale(0) == _ENABLE_PER_THREAD_LOCALE);
-
- // Retrieve the current thread-specific locale
- locale_t old_locale = bIsPerThread ? _get_current_locale() : LC_GLOBAL_LOCALE;
-
- if(new_locale == LC_GLOBAL_LOCALE)
- {
- // Restore the global locale
- _configthreadlocale(_DISABLE_PER_THREAD_LOCALE);
- }
- else if(new_locale != nullptr)
- {
- // Configure the thread to set the locale only for this thread
- _configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
-
- // Set all locale categories
- for(int i = LC_MIN; i <= LC_MAX; i++)
- setlocale(i, new_locale->locinfo->lc_category[i].locale);
- }
-
- return old_locale;
- }
extern "C" {
__declspec(dllimport) void __stdcall DebugBreak(void);