• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // File: vk_sdk_platform.h
3 //
4 /*
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  *
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  */
28 
29 #ifndef VK_SDK_PLATFORM_H
30 #define VK_SDK_PLATFORM_H
31 
32 #if defined(_WIN32)
33 #define NOMINMAX
34 #ifndef __cplusplus
35 #undef inline
36 #define inline __inline
37 #endif // __cplusplus
38 
39 #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
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).
45 // NOTE: This is fixed in Visual Studio 2015.
46 #define snprintf _snprintf
47 #endif
48 
49 #define strdup _strdup
50 
51 #endif // _WIN32
52 
53 #endif // VK_SDK_PLATFORM_H
54