gfx/angle/src/compiler/ossource_win.cpp

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

     1 //
     2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
     3 // Use of this source code is governed by a BSD-style license that can be
     4 // found in the LICENSE file.
     5 //
     7 #include "compiler/osinclude.h"
     8 //
     9 // This file contains contains the window's specific functions
    10 //
    12 #if !defined(ANGLE_OS_WIN)
    13 #error Trying to build a windows specific file in a non windows build.
    14 #endif
    17 //
    18 // Thread Local Storage Operations
    19 //
    20 OS_TLSIndex OS_AllocTLSIndex()
    21 {
    22 	DWORD dwIndex = TlsAlloc();
    23 	if (dwIndex == TLS_OUT_OF_INDEXES) {
    24 		assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage");
    25 		return OS_INVALID_TLS_INDEX;
    26 	}
    28 	return dwIndex;
    29 }
    32 bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue)
    33 {
    34 	if (nIndex == OS_INVALID_TLS_INDEX) {
    35 		assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
    36 		return false;
    37 	}
    39 	if (TlsSetValue(nIndex, lpvValue))
    40 		return true;
    41 	else
    42 		return false;
    43 }
    46 bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
    47 {
    48 	if (nIndex == OS_INVALID_TLS_INDEX) {
    49 		assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
    50 		return false;
    51 	}
    53 	if (TlsFree(nIndex))
    54 		return true;
    55 	else
    56 		return false;
    57 }

mercurial