Mark Lobodzinski | eccbb37 | 2015-09-01 09:00:16 -0600 | [diff] [blame] | 1 | // |
| 2 | // File: vk_sdk_platform.h |
| 3 | // |
Mark Lobodzinski | eccbb37 | 2015-09-01 09:00:16 -0600 | [diff] [blame] | 4 | /* |
Karl Schultz | 673df32 | 2016-02-02 12:32:50 -0700 | [diff] [blame] | 5 | * Copyright (c) 2015-2016 The Khronos Group Inc. |
| 6 | * Copyright (c) 2015-2016 Valve Corporation |
| 7 | * Copyright (c) 2015-2016 LunarG, Inc. |
| 8 | * |
| 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 10 | * of this software and/or associated documentation files (the "Materials"), to |
| 11 | * deal in the Materials without restriction, including without limitation the |
| 12 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 13 | * sell copies of the Materials, and to permit persons to whom the Materials are |
| 14 | * furnished to do so, subject to the following conditions: |
| 15 | * |
| 16 | * The above copyright notice(s) and this permission notice shall be included in |
| 17 | * all copies or substantial portions of the Materials. |
| 18 | * |
Karl Schultz | 673df32 | 2016-02-02 12:32:50 -0700 | [diff] [blame] | 19 | * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 22 | * |
| 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
| 24 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 25 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE |
| 26 | * USE OR OTHER DEALINGS IN THE MATERIALS. |
| 27 | */ |
Mark Lobodzinski | eccbb37 | 2015-09-01 09:00:16 -0600 | [diff] [blame] | 28 | |
| 29 | #ifndef VK_SDK_PLATFORM_H |
| 30 | #define VK_SDK_PLATFORM_H |
| 31 | |
| 32 | #if defined(_WIN32) |
Karl Schultz | 673df32 | 2016-02-02 12:32:50 -0700 | [diff] [blame] | 33 | #define NOMINMAX |
| 34 | #ifndef __cplusplus |
| 35 | #undef inline |
| 36 | #define inline __inline |
| 37 | #endif // __cplusplus |
Courtney Goeltzenleuchter | c3f3742 | 2015-09-24 11:51:05 -0600 | [diff] [blame] | 38 | |
Mark Young | cbd7c6b | 2016-01-06 14:26:04 -0700 | [diff] [blame] | 39 | #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) |
Courtney Goeltzenleuchter | c3f3742 | 2015-09-24 11:51:05 -0600 | [diff] [blame] | 40 | // C99: |
| 41 | // Microsoft didn't implement C99 in Visual Studio; but started adding it with |
| 42 | // VS2013. However, VS2013 still didn't have snprintf(). The following is a |
| 43 | // work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the |
| 44 | // "CMakeLists.txt" file). |
Mark Young | cbd7c6b | 2016-01-06 14:26:04 -0700 | [diff] [blame] | 45 | // NOTE: This is fixed in Visual Studio 2015. |
Courtney Goeltzenleuchter | c3f3742 | 2015-09-24 11:51:05 -0600 | [diff] [blame] | 46 | #define snprintf _snprintf |
Karl Schultz | 673df32 | 2016-02-02 12:32:50 -0700 | [diff] [blame] | 47 | #endif |
Mark Young | cbd7c6b | 2016-01-06 14:26:04 -0700 | [diff] [blame] | 48 | |
Courtney Goeltzenleuchter | c3f3742 | 2015-09-24 11:51:05 -0600 | [diff] [blame] | 49 | #define strdup _strdup |
| 50 | |
Mark Lobodzinski | eccbb37 | 2015-09-01 09:00:16 -0600 | [diff] [blame] | 51 | #endif // _WIN32 |
| 52 | |
| 53 | #endif // VK_SDK_PLATFORM_H |