From: Tsuda Kageyu Date: Fri, 31 Jul 2015 01:10:12 +0000 (+0900) Subject: Reorder CMake checks for sprintf() variants. X-Git-Tag: v1.10beta~54 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c69364d83115950b24e6baa6b9841a244d149d91;p=taglib Reorder CMake checks for sprintf() variants. VS2015 has snprintf(), however sprintf_s() is still recommended. --- diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 2a45226e..374fa7ab 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -211,20 +211,20 @@ check_cxx_source_compiles(" #include int main() { char buf[20]; - snprintf(buf, 20, \"%d\", 1); + sprintf_s(buf, \"%d\", 1); return 0; } -" HAVE_SNPRINTF) +" HAVE_SPRINTF_S) -if(NOT HAVE_SNPRINTF) +if(NOT HAVE_SPRINTF_S) check_cxx_source_compiles(" #include int main() { char buf[20]; - sprintf_s(buf, \"%d\", 1); + snprintf(buf, 20, \"%d\", 1); return 0; } - " HAVE_SPRINTF_S) + " HAVE_SNPRINTF) endif() # Check for libz using the cmake supplied FindZLIB.cmake