Issue 354: remove ANGLE_USE_NSPR (revert r454)

git-svn-id: https://angleproject.googlecode.com/svn/trunk@1327 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent b401a92b
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 1326 #define BUILD_REVISION 1327
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -24,9 +24,7 @@ ...@@ -24,9 +24,7 @@
#error Unsupported platform. #error Unsupported platform.
#endif #endif
#if defined(ANGLE_USE_NSPR) #if defined(ANGLE_OS_WIN)
#include "prthread.h"
#elif defined(ANGLE_OS_WIN)
#define STRICT #define STRICT
#define VC_EXTRALEAN 1 #define VC_EXTRALEAN 1
#include <windows.h> #include <windows.h>
...@@ -34,7 +32,7 @@ ...@@ -34,7 +32,7 @@
#include <pthread.h> #include <pthread.h>
#include <semaphore.h> #include <semaphore.h>
#include <errno.h> #include <errno.h>
#endif // ANGLE_USE_NSPR #endif // ANGLE_OS_WIN
#include "compiler/debug.h" #include "compiler/debug.h"
...@@ -42,16 +40,13 @@ ...@@ -42,16 +40,13 @@
// //
// Thread Local Storage Operations // Thread Local Storage Operations
// //
#if defined(ANGLE_USE_NSPR) #if defined(ANGLE_OS_WIN)
typedef PRUintn OS_TLSIndex;
#define OS_INVALID_TLS_INDEX 0xFFFFFFFF
#elif defined(ANGLE_OS_WIN)
typedef DWORD OS_TLSIndex; typedef DWORD OS_TLSIndex;
#define OS_INVALID_TLS_INDEX (TLS_OUT_OF_INDEXES) #define OS_INVALID_TLS_INDEX (TLS_OUT_OF_INDEXES)
#elif defined(ANGLE_OS_POSIX) #elif defined(ANGLE_OS_POSIX)
typedef unsigned int OS_TLSIndex; typedef unsigned int OS_TLSIndex;
#define OS_INVALID_TLS_INDEX 0xFFFFFFFF #define OS_INVALID_TLS_INDEX 0xFFFFFFFF
#endif // ANGLE_USE_NSPR #endif // ANGLE_OS_WIN
OS_TLSIndex OS_AllocTLSIndex(); OS_TLSIndex OS_AllocTLSIndex();
bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue); bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue);
...@@ -60,9 +55,7 @@ bool OS_FreeTLSIndex(OS_TLSIndex nIndex); ...@@ -60,9 +55,7 @@ bool OS_FreeTLSIndex(OS_TLSIndex nIndex);
inline void* OS_GetTLSValue(OS_TLSIndex nIndex) inline void* OS_GetTLSValue(OS_TLSIndex nIndex)
{ {
ASSERT(nIndex != OS_INVALID_TLS_INDEX); ASSERT(nIndex != OS_INVALID_TLS_INDEX);
#if defined(ANGLE_USE_NSPR) #if defined(ANGLE_OS_WIN)
return PR_GetThreadPrivate(nIndex);
#elif defined(ANGLE_OS_WIN)
return TlsGetValue(nIndex); return TlsGetValue(nIndex);
#elif defined(ANGLE_OS_POSIX) #elif defined(ANGLE_OS_POSIX)
return pthread_getspecific(nIndex); return pthread_getspecific(nIndex);
......
//
// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
//
// This file contains the nspr specific functions
//
#include "compiler/osinclude.h"
//
// Thread Local Storage Operations
//
OS_TLSIndex OS_AllocTLSIndex()
{
PRUintn index;
PRStatus status = PR_NewThreadPrivateIndex(&index, NULL);
if (status) {
assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage");
return OS_INVALID_TLS_INDEX;
}
return index;
}
bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue)
{
if (nIndex == OS_INVALID_TLS_INDEX) {
assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
return false;
}
return PR_SetThreadPrivate(nIndex, lpvValue) == 0;
}
bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
{
// Can't delete TLS keys with nspr
return true;
}
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