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