LCOV - app.info - gfx/angle/src/compiler/osinclude.h

LCOV - code coverage report
| Current view: | directory - gfx/angle/src/compiler - osinclude.h (source / functions) |  | Found | Hit | Coverage |
| Test: | app.info | Lines: | 3 | 0 | 0.0 %
| Date: | 2012-07-07 | Functions: | 1 | 0 | 0.0 %

           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                 : //
           6                 :
           7                 : #ifndef __OSINCLUDE_H
           8                 : #define __OSINCLUDE_H
           9                 :
          10                 : //
          11                 : // This file contains contains os-specific datatypes and
          12                 : // declares any os-specific functions.
          13                 : //
          14                 :
          15                 : #if defined(_WIN32) || defined(_WIN64)
          16                 : #define ANGLE_OS_WIN
          17                 : #elif defined(__APPLE__) || defined(__linux__) || \
          18                 :       defined(__FreeBSD__) || defined(__OpenBSD__) || \
          19                 :       defined(__sun) || defined(ANDROID) || \
          20                 :       defined(__GLIBC__) || defined(__GNU__)
          21                 : #define ANGLE_OS_POSIX
          22                 : #else
          23                 : #error Unsupported platform.
          24                 : #endif
          25                 :
          26                 : #if defined(ANGLE_USE_NSPR)
          27                 : #include "prthread.h"
          28                 : #elif defined(ANGLE_OS_WIN)
          29                 : #define STRICT
          30                 : #define VC_EXTRALEAN 1
          31                 : #include <windows.h>
          32                 : #elif defined(ANGLE_OS_POSIX)
          33                 : #include <pthread.h>
          34                 : #include <semaphore.h>
          35                 : #include <errno.h>
          36                 : #endif  // ANGLE_USE_NSPR
          37                 :
          38                 :
          39                 : #include "compiler/compilerdebug.h"
          40                 :
          41                 : //
          42                 : // Thread Local Storage Operations
          43                 : //
          44                 : #if defined(ANGLE_USE_NSPR)
          45                 : typedef PRUintn OS_TLSIndex;
          46                 : #define OS_INVALID_TLS_INDEX 0xFFFFFFFF
          47                 : #elif defined(ANGLE_OS_WIN)
          48                 : typedef DWORD OS_TLSIndex;
          49                 : #define OS_INVALID_TLS_INDEX (TLS_OUT_OF_INDEXES)
          50                 : #elif defined(ANGLE_OS_POSIX)
          51                 : typedef unsigned int OS_TLSIndex;
          52                 : #define OS_INVALID_TLS_INDEX 0xFFFFFFFF
          53                 : #endif  // ANGLE_USE_NSPR
          54                 :
          55                 : OS_TLSIndex OS_AllocTLSIndex();
          56                 : bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue);
          57                 : bool OS_FreeTLSIndex(OS_TLSIndex nIndex);
          58                 :
          59               0 : inline void* OS_GetTLSValue(OS_TLSIndex nIndex)
          60                 : {
          61               0 :     ASSERT(nIndex != OS_INVALID_TLS_INDEX);
          62                 : #if defined(ANGLE_USE_NSPR)
          63               0 :     return PR_GetThreadPrivate(nIndex);
          64                 : #elif defined(ANGLE_OS_WIN)
          65                 :     return TlsGetValue(nIndex);
          66                 : #elif defined(ANGLE_OS_POSIX)
          67                 :     return pthread_getspecific(nIndex);
          68                 : #endif  // ANGLE_OS_WIN
          69                 : }
          70                 :
          71                 : #endif // __OSINCLUDE_H

Generated by: LCOV version 1.7