summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ConfigureChecks.cmake2
-rw-r--r--configure.ac1
-rw-r--r--test/perf-test.cc6
3 files changed, 7 insertions, 2 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 9f67b43c..d3f57325 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -36,6 +36,8 @@ check_function_exists(popen HAVE_POPEN)
check_function_exists(mkstemp HAVE_MKSTEMP)
check_function_exists(mkstemps HAVE_MKSTEMPS)
check_function_exists(rand_r HAVE_RAND_R)
+check_function_exists(strcpy_s HAVE_STRCPY_S)
+check_function_exists(strcat_s HAVE_STRCAT_S)
macro(CHECK_FOR_DIR include var)
check_c_source_compiles(
diff --git a/configure.ac b/configure.ac
index 624b62d8..f03d65fb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -251,6 +251,7 @@ fi
dnl ##### Checks for library functions.
AC_CHECK_FUNCS(popen mkstemp mkstemps)
+AC_CHECK_FUNCS(strcpy_s strcat_s)
dnl ##### Back to C for the library tests.
AC_LANG_C
diff --git a/test/perf-test.cc b/test/perf-test.cc
index 84bbcda1..da14a7c7 100644
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -1,5 +1,5 @@
/* Copyright Krzysztof Kowalczyk 2006-2007
- Copyright Hib Eris <hib@hiberis.nl> 2008
+ Copyright Hib Eris <hib@hiberis.nl> 2008, 2013
License: GPLv2 */
/*
A tool to stress-test poppler rendering and measure rendering times for
@@ -325,7 +325,7 @@ void sleep_milliseconds(int milliseconds)
#endif
}
-#ifndef _MSC_VER
+#ifndef HAVE_STRCPY_S
void strcpy_s(char* dst, size_t dst_size, const char* src)
{
size_t src_size = strlen(src) + 1;
@@ -338,7 +338,9 @@ void strcpy_s(char* dst, size_t dst_size, const char* src)
}
}
}
+#endif
+#ifndef HAVE_STRCAT_S
void strcat_s(char *dst, size_t dst_size, const char* src)
{
size_t dst_len = strlen(dst);