RetroArch
vk_sdk_platform.h
Go to the documentation of this file.
1 /* File: vk_sdk_platform.h */
2 
3 /*
4  * Copyright (c) 2015-2016 The Khronos Group Inc.
5  * Copyright (c) 2015-2016 Valve Corporation
6  * Copyright (c) 2015-2016 LunarG, Inc.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef VK_SDK_PLATFORM_H
22 #define VK_SDK_PLATFORM_H
23 
24 #if defined(_WIN32)
25 #define NOMINMAX
26 #ifndef __cplusplus
27 #undef inline
28 #define inline __inline
29 #endif /* __cplusplus */
30 
31 #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
32 /* C99:
33  * Microsoft didn't implement C99 in Visual Studio; but started adding it with
34  * VS2013. However, VS2013 still didn't have snprintf(). The following is a
35  * work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the
36  * "CMakeLists.txt" file).
37  * NOTE: This is fixed in Visual Studio 2015. */
38 #define snprintf _snprintf
39 #endif
40 
41 #define strdup _strdup
42 
43 #endif /* _WIN32 */
44 
45 /* Check for noexcept support using clang, with fallback to Windows or GCC version numbers */
46 #ifndef NOEXCEPT
47 #if defined(__clang__)
48 #if __has_feature(cxx_noexcept)
49 #define HAS_NOEXCEPT
50 #endif
51 #else
52 #if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46
53 #define HAS_NOEXCEPT
54 #else
55 #if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS
56 #define HAS_NOEXCEPT
57 #endif
58 #endif
59 #endif
60 
61 #ifdef HAS_NOEXCEPT
62 #define NOEXCEPT noexcept
63 #else
64 #define NOEXCEPT
65 #endif
66 #endif
67 
68 #endif /* VK_SDK_PLATFORM_H */