vk_sdk_platform.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #ifndef VK_SDK_PLATFORM_H
  29. #define VK_SDK_PLATFORM_H
  30. #if defined(_WIN32)
  31. #define NOMINMAX
  32. #ifndef __cplusplus
  33. #undef inline
  34. #define inline __inline
  35. #endif // __cplusplus
  36. #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
  37. // C99:
  38. // Microsoft didn't implement C99 in Visual Studio; but started adding it with
  39. // VS2013. However, VS2013 still didn't have snprintf(). The following is a
  40. // work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the
  41. // "CMakeLists.txt" file).
  42. // NOTE: This is fixed in Visual Studio 2015.
  43. #define snprintf _snprintf
  44. #endif
  45. #define strdup _strdup
  46. #endif // _WIN32
  47. #endif // VK_SDK_PLATFORM_H