Simplifying macros to fix VS' broken preprocessor.

This commit is contained in:
Ben Vanik
2014-01-12 14:06:00 -08:00
parent 123444078f
commit 6129e1eb7a
26 changed files with 76 additions and 83 deletions

View File

@@ -147,7 +147,7 @@ void XThread::set_name(const char* name) {
}
name_ = xestrdupa(name);
#if XE_PLATFORM(WIN32)
#if XE_PLATFORM_WIN32
// Do the nasty set for us.
#pragma pack(push, 8)
typedef struct tagTHREADNAME_INFO {
@@ -249,7 +249,7 @@ X_STATUS XThread::Exit(int exit_code) {
return X_STATUS_SUCCESS;
}
#if XE_PLATFORM(WIN32)
#if XE_PLATFORM_WIN32
static uint32_t __stdcall XThreadStartCallbackWin32(void* param) {
XThread* thread = reinterpret_cast<XThread*>(param);
@@ -308,7 +308,7 @@ X_STATUS XThread::PlatformCreate() {
int result_code;
if (creation_params_.creation_flags & X_CREATE_SUSPENDED) {
#if XE_PLATFORM(OSX)
#if XE_PLATFORM_OSX
result_code = pthread_create_suspended_np(
reinterpret_cast<pthread_t*>(&thread_handle_),
&attr,

View File

@@ -465,7 +465,7 @@ uint32_t xeKeTlsAlloc() {
uint32_t tls_index;
#if XE_PLATFORM(WIN32)
#if XE_PLATFORM_WIN32
tls_index = TlsAlloc();
#else
pthread_key_t key;
@@ -501,7 +501,7 @@ int KeTlsFree(uint32_t tls_index) {
int result_code = 0;
#if XE_PLATFORM(WIN32)
#if XE_PLATFORM_WIN32
result_code = TlsFree(tls_index);
#else
result_code = pthread_key_delete(tls_index) == 0;
@@ -531,7 +531,7 @@ uint64_t xeKeTlsGetValue(uint32_t tls_index) {
uint64_t value = 0;
#if XE_PLATFORM(WIN32)
#if XE_PLATFORM_WIN32
value = (uint64_t)TlsGetValue(tls_index);
#else
value = (uint64_t)pthread_getspecific(tls_index);
@@ -567,7 +567,7 @@ int xeKeTlsSetValue(uint32_t tls_index, uint64_t tls_value) {
int result_code = 0;
#if XE_PLATFORM(WIN32)
#if XE_PLATFORM_WIN32
result_code = TlsSetValue(tls_index, (LPVOID)tls_value);
#else
result_code = pthread_setspecific(tls_index, (void*)tls_value) == 0;