Commit fb839475 by Shannon Woods

Fix ifdef complaints in clang

BUG=angle:677 Change-Id: Iee457dfc0990e5ffd61932b1f286f3c0208568bc Reviewed-on: https://chromium-review.googlesource.com/203427Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent a0dc219e
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "common/platform.h" #include "common/platform.h"
#if !defined(TRACE_ENTRY) #if !defined(TRACE_ENTRY)
# if ANGLE_PLATFORM_WINDOWS # ifdef ANGLE_PLATFORM_WINDOWS
# define TRACE_ENTRY __stdcall # define TRACE_ENTRY __stdcall
# else # else
# define TRACE_ENTRY # define TRACE_ENTRY
......
...@@ -109,7 +109,7 @@ inline unsigned int unorm(float x) ...@@ -109,7 +109,7 @@ inline unsigned int unorm(float x)
inline bool supportsSSE2() inline bool supportsSSE2()
{ {
#if ANGLE_PLATFORM_WINDOWS #ifdef ANGLE_PLATFORM_WINDOWS
static bool checked = false; static bool checked = false;
static bool supports = false; static bool supports = false;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
# error Unsupported platform. # error Unsupported platform.
#endif #endif
#if ANGLE_PLATFORM_WINDOWS #ifdef ANGLE_PLATFORM_WINDOWS
# ifndef STRICT # ifndef STRICT
# define STRICT 1 # define STRICT 1
# endif # endif
......
...@@ -14,9 +14,9 @@ TLSIndex CreateTLSIndex() ...@@ -14,9 +14,9 @@ TLSIndex CreateTLSIndex()
{ {
TLSIndex index; TLSIndex index;
#if ANGLE_PLATFORM_WINDOWS #ifdef ANGLE_PLATFORM_WINDOWS
index = TlsAlloc(); index = TlsAlloc();
#elif ANGLE_PLATFORM_POSIX #elif defined(ANGLE_PLATFORM_POSIX)
// Create global pool key // Create global pool key
if ((pthread_key_create(&index, NULL)) != 0) if ((pthread_key_create(&index, NULL)) != 0)
{ {
...@@ -36,9 +36,9 @@ bool DestroyTLSIndex(TLSIndex index) ...@@ -36,9 +36,9 @@ bool DestroyTLSIndex(TLSIndex index)
return false; return false;
} }
#if ANGLE_PLATFORM_WINDOWS #ifdef ANGLE_PLATFORM_WINDOWS
return (TlsFree(index) == TRUE); return (TlsFree(index) == TRUE);
#elif ANGLE_PLATFORM_POSIX #elif defined(ANGLE_PLATFORM_POSIX)
return (pthread_key_delete(index) == 0); return (pthread_key_delete(index) == 0);
#endif #endif
} }
...@@ -51,9 +51,9 @@ bool SetTLSValue(TLSIndex index, void *value) ...@@ -51,9 +51,9 @@ bool SetTLSValue(TLSIndex index, void *value)
return false; return false;
} }
#if ANGLE_PLATFORM_WINDOWS #ifdef ANGLE_PLATFORM_WINDOWS
return (TlsSetValue(index, value) == TRUE); return (TlsSetValue(index, value) == TRUE);
#elif ANGLE_PLATFORM_POSIX #elif defined(ANGLE_PLATFORM_POSIX)
return (pthread_setspecific(index, value) == 0); return (pthread_setspecific(index, value) == 0);
#endif #endif
} }
...@@ -66,9 +66,9 @@ void *GetTLSValue(TLSIndex index) ...@@ -66,9 +66,9 @@ void *GetTLSValue(TLSIndex index)
return NULL; return NULL;
} }
#if ANGLE_PLATFORM_WINDOWS #ifdef ANGLE_PLATFORM_WINDOWS
return TlsGetValue(index); return TlsGetValue(index);
#elif ANGLE_PLATFORM_POSIX #elif defined(ANGLE_PLATFORM_POSIX)
return pthread_getspecific(index); return pthread_getspecific(index);
#endif #endif
} }
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
#include "common/platform.h" #include "common/platform.h"
#if ANGLE_PLATFORM_WINDOWS #ifdef ANGLE_PLATFORM_WINDOWS
typedef DWORD TLSIndex; typedef DWORD TLSIndex;
# define TLS_INVALID_INDEX (TLS_OUT_OF_INDEXES) # define TLS_INVALID_INDEX (TLS_OUT_OF_INDEXES)
#elif ANGLE_PLATFORM_POSIX #elif defined(ANGLE_PLATFORM_POSIX)
# include <pthread.h> # include <pthread.h>
# include <semaphore.h> # include <semaphore.h>
# include <errno.h> # include <errno.h>
......
...@@ -433,7 +433,7 @@ bool IsTriangleMode(GLenum drawMode) ...@@ -433,7 +433,7 @@ bool IsTriangleMode(GLenum drawMode)
std::string getTempPath() std::string getTempPath()
{ {
#if ANGLE_PLATFORM_WINDOWS #ifdef ANGLE_PLATFORM_WINDOWS
char path[MAX_PATH]; char path[MAX_PATH];
DWORD pathLen = GetTempPathA(sizeof(path) / sizeof(path[0]), path); DWORD pathLen = GetTempPathA(sizeof(path) / sizeof(path[0]), path);
if (pathLen == 0) if (pathLen == 0)
......
...@@ -584,7 +584,7 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height) ...@@ -584,7 +584,7 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
// Draw // Draw
deviceContext->Draw(4, 0); deviceContext->Draw(4, 0);
#if ANGLE_FORCE_VSYNC_OFF #ifdef ANGLE_FORCE_VSYNC_OFF
result = mSwapChain->Present(0, 0); result = mSwapChain->Present(0, 0);
#else #else
result = mSwapChain->Present(mSwapInterval, 0); result = mSwapChain->Present(mSwapInterval, 0);
......
...@@ -50,7 +50,7 @@ void SwapChain9::release() ...@@ -50,7 +50,7 @@ void SwapChain9::release()
static DWORD convertInterval(EGLint interval) static DWORD convertInterval(EGLint interval)
{ {
#if ANGLE_FORCE_VSYNC_OFF #ifdef ANGLE_FORCE_VSYNC_OFF
return D3DPRESENT_INTERVAL_IMMEDIATE; return D3DPRESENT_INTERVAL_IMMEDIATE;
#else #else
switch(interval) switch(interval)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment