Path: blob/master/3rdparty/include/vulkan/vk_platform.h
16354 views
//1// File: vk_platform.h2//3/*4** Copyright (c) 2014-2017 The Khronos Group Inc.5**6** Licensed under the Apache License, Version 2.0 (the "License");7** you may not use this file except in compliance with the License.8** You may obtain a copy of the License at9**10** http://www.apache.org/licenses/LICENSE-2.011**12** Unless required by applicable law or agreed to in writing, software13** distributed under the License is distributed on an "AS IS" BASIS,14** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15** See the License for the specific language governing permissions and16** limitations under the License.17*/181920#ifndef VK_PLATFORM_H_21#define VK_PLATFORM_H_2223#ifdef __cplusplus24extern "C"25{26#endif // __cplusplus2728/*29***************************************************************************************************30* Platform-specific directives and type declarations31***************************************************************************************************32*/3334/* Platform-specific calling convention macros.35*36* Platforms should define these so that Vulkan clients call Vulkan commands37* with the same calling conventions that the Vulkan implementation expects.38*39* VKAPI_ATTR - Placed before the return type in function declarations.40* Useful for C++11 and GCC/Clang-style function attribute syntax.41* VKAPI_CALL - Placed after the return type in function declarations.42* Useful for MSVC-style calling convention syntax.43* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.44*45* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);46* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);47*/48#if defined(_WIN32)49// On Windows, Vulkan commands use the stdcall convention50#define VKAPI_ATTR51#define VKAPI_CALL __stdcall52#define VKAPI_PTR VKAPI_CALL53#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 754#error "Vulkan isn't supported for the 'armeabi' NDK ABI"55#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)56// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"57// calling convention, i.e. float parameters are passed in registers. This58// is true even if the rest of the application passes floats on the stack,59// as it does by default when compiling for the armeabi-v7a NDK ABI.60#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))61#define VKAPI_CALL62#define VKAPI_PTR VKAPI_ATTR63#else64// On other platforms, use the default calling convention65#define VKAPI_ATTR66#define VKAPI_CALL67#define VKAPI_PTR68#endif6970#include <stddef.h>7172#if !defined(VK_NO_STDINT_H)73#if defined(_MSC_VER) && (_MSC_VER < 1600)74typedef signed __int8 int8_t;75typedef unsigned __int8 uint8_t;76typedef signed __int16 int16_t;77typedef unsigned __int16 uint16_t;78typedef signed __int32 int32_t;79typedef unsigned __int32 uint32_t;80typedef signed __int64 int64_t;81typedef unsigned __int64 uint64_t;82#else83#include <stdint.h>84#endif85#endif // !defined(VK_NO_STDINT_H)8687#ifdef __cplusplus88} // extern "C"89#endif // __cplusplus9091#endif929394