From bdf6688bb7e264486298605cd1587cd73938ffe1 Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Thu, 24 Sep 2015 11:51:05 -0600 Subject: misc: Move snprintf define to vk_sdk_platform.h Windows doesn't define snprintf so we need to #define it to what Windows does use in our SDK platform header. --- include/vk_sdk_platform.h | 9 +++++++++ layers/vk_layer_config.cpp | 2 +- loader/vk_loader_platform.h | 10 ---------- 3 files changed, 10 insertions(+), 11 deletions(-) mode change 100644 => 100755 include/vk_sdk_platform.h mode change 100644 => 100755 layers/vk_layer_config.cpp diff --git a/include/vk_sdk_platform.h b/include/vk_sdk_platform.h old mode 100644 new mode 100755 index 0f9b4cad..d5e31a83 --- a/include/vk_sdk_platform.h +++ b/include/vk_sdk_platform.h @@ -34,6 +34,15 @@ # undef inline # define inline __inline # endif // __cplusplus + +// C99: +// Microsoft didn't implement C99 in Visual Studio; but started adding it with +// VS2013. However, VS2013 still didn't have snprintf(). The following is a +// work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the +// "CMakeLists.txt" file). +#define snprintf _snprintf +#define strdup _strdup + #endif // _WIN32 #endif // VK_SDK_PLATFORM_H diff --git a/layers/vk_layer_config.cpp b/layers/vk_layer_config.cpp old mode 100644 new mode 100755 index e3b6d873..66254c74 --- a/layers/vk_layer_config.cpp +++ b/layers/vk_layer_config.cpp @@ -30,7 +30,7 @@ #include #include #include "vk_layer_config.h" -#include "vk_loader_platform.h" +#include "vk_sdk_platform.h" #define MAX_CHARS_PER_LINE 4096 diff --git a/loader/vk_loader_platform.h b/loader/vk_loader_platform.h index 9a690f5f..96021561 100644 --- a/loader/vk_loader_platform.h +++ b/loader/vk_loader_platform.h @@ -233,16 +233,6 @@ using namespace std; #define DEFAULT_VK_LAYERS_PATH "C:\\Windows\\System32;C:\\Windows\\SysWow64" #define LAYERS_PATH_ENV "VK_LAYER_PATH" -// C99: -// Microsoft didn't implement C99 in Visual Studio; but started adding it with -// VS2013. However, VS2013 still didn't have snprintf(). The following is a -// work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the -// "CMakeLists.txt" file). -#define snprintf _snprintf -#define strdup _strdup -#define PRINTF_SIZE_T_SPECIFIER "%Iu" - - // File IO static bool loader_platform_file_exists(const char *path) { -- cgit v1.2.3