Home | History | Annotate | Download | only in common
      1 //
      2 // Copyright (c) 2014 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 // platform.h: Operating system specific includes and defines.
      8 
      9 #ifndef COMMON_PLATFORM_H_
     10 #define COMMON_PLATFORM_H_
     11 
     12 #if defined(_WIN32) || defined(_WIN64)
     13 #   define ANGLE_PLATFORM_WINDOWS 1
     14 #elif defined(__APPLE__)
     15 #   define ANGLE_PLATFORM_APPLE 1
     16 #   define ANGLE_PLATFORM_POSIX 1
     17 #elif defined(__linux__)
     18 #   define ANGLE_PLATFORM_LINUX 1
     19 #   define ANGLE_PLATFORM_POSIX 1
     20 #elif defined(ANDROID)
     21 #   define ANGLE_PLATFORM_ANDROID 1
     22 #   define ANGLE_PLATFORM_POSIX 1
     23 #elif defined(__FreeBSD__) || \
     24       defined(__OpenBSD__) || \
     25       defined(__NetBSD__) || \
     26       defined(__DragonFly__) || \
     27       defined(__sun) || \
     28       defined(__GLIBC__) || \
     29       defined(__GNU__) || \
     30       defined(__QNX__)
     31 #   define ANGLE_PLATFORM_POSIX 1
     32 #else
     33 #   error Unsupported platform.
     34 #endif
     35 
     36 #ifdef ANGLE_PLATFORM_WINDOWS
     37 #   ifndef STRICT
     38 #       define STRICT 1
     39 #   endif
     40 #   ifndef WIN32_LEAN_AND_MEAN
     41 #       define WIN32_LEAN_AND_MEAN 1
     42 #   endif
     43 #   ifndef NOMINMAX
     44 #       define NOMINMAX 1
     45 #   endif
     46 
     47 #   include <windows.h>
     48 #   include <intrin.h>
     49 
     50 #   if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_PERF)
     51 #       include <d3d9.h>
     52 #       include <d3dcompiler.h>
     53 #   endif
     54 
     55 #   if defined(ANGLE_ENABLE_D3D11)
     56 #       include <d3d10_1.h>
     57 #       include <d3d11.h>
     58 #       include <dxgi.h>
     59 #       include <dxgi1_2.h>
     60 #       include <d3dcompiler.h>
     61 #   endif
     62 
     63 #   undef near
     64 #   undef far
     65 #endif
     66 
     67 #endif // COMMON_PLATFORM_H_
     68