From 988c35fb30c2158ce81ef76483a3e5e6e7a9a57d Mon Sep 17 00:00:00 2001 From: Ian Elliott Date: Wed, 4 Feb 2015 12:06:46 -0700 Subject: Win: Eliminate VS2013 compiler warnings for "loader.c" ... As part of this, eliminated some similar warnings within/across usage of "loader_platform.h". One of these is #define'ing _CRT_SECURE_NO_WARNINGS, so that VisualStudio won't issue warnings with our use of _snprint() (which they don't consider secure enough; but their desired function doesn't match the signature of snprintf()). --- loader/loader_platform.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'loader/loader_platform.h') diff --git a/loader/loader_platform.h b/loader/loader_platform.h index 0ff9671d..e567700b 100644 --- a/loader/loader_platform.h +++ b/loader/loader_platform.h @@ -167,7 +167,8 @@ using namespace std; // 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. +// work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the +// "CMakeLists.txt" file). #define snprintf _snprintf #define STATIC_INLINE static // Microsoft also doesn't have basename(). Paths are different on Windows, and @@ -192,6 +193,8 @@ static char *basename(char *pathname) next++; } } + // We shouldn't get to here, but this makes the compiler happy: + return current; } // Dynamic Loading: -- cgit v1.2.3