blob: f79396bac131139b9e51f8cb383eb08dcb4f18fb [file] [log] [blame]
Mark Lobodzinskieccbb372015-09-01 09:00:16 -06001//
2// File: vk_sdk_platform.h
3//
Mark Lobodzinskieccbb372015-09-01 09:00:16 -06004/*
Karl Schultz673df322016-02-02 12:32:50 -07005 * 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 Schultz673df322016-02-02 12:32:50 -070019 * 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 Lobodzinskieccbb372015-09-01 09:00:16 -060028
29#ifndef VK_SDK_PLATFORM_H
30#define VK_SDK_PLATFORM_H
31
32#if defined(_WIN32)
Karl Schultz673df322016-02-02 12:32:50 -070033#define NOMINMAX
34#ifndef __cplusplus
35#undef inline
36#define inline __inline
37#endif // __cplusplus
Courtney Goeltzenleuchterc3f37422015-09-24 11:51:05 -060038
Mark Youngcbd7c6b2016-01-06 14:26:04 -070039#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
Courtney Goeltzenleuchterc3f37422015-09-24 11:51:05 -060040// 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 Youngcbd7c6b2016-01-06 14:26:04 -070045// NOTE: This is fixed in Visual Studio 2015.
Courtney Goeltzenleuchterc3f37422015-09-24 11:51:05 -060046#define snprintf _snprintf
Karl Schultz673df322016-02-02 12:32:50 -070047#endif
Mark Youngcbd7c6b2016-01-06 14:26:04 -070048
Courtney Goeltzenleuchterc3f37422015-09-24 11:51:05 -060049#define strdup _strdup
50
Mark Lobodzinskieccbb372015-09-01 09:00:16 -060051#endif // _WIN32
52
53#endif // VK_SDK_PLATFORM_H