summaryrefslogtreecommitdiff
path: root/thirdparty
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2015-03-05 13:13:52 +0000
committerJosé Fonseca <jfonseca@vmware.com>2015-03-05 14:00:09 +0000
commit1c5a703b9ebaa224b0fbd6daaa3265d6cc963e47 (patch)
treebcfa0de1ca661b35321ad818b54a8cc96d2b3be1 /thirdparty
parenta96dd3f9054d9ab71e4fc3019f223bd78b7a68fe (diff)
dxerr: Provide strcpy_s for older MinGW.
Diffstat (limited to 'thirdparty')
-rw-r--r--thirdparty/dxerr/dxerr.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/thirdparty/dxerr/dxerr.cpp b/thirdparty/dxerr/dxerr.cpp
index ede5d3d0..9d3621c7 100644
--- a/thirdparty/dxerr/dxerr.cpp
+++ b/thirdparty/dxerr/dxerr.cpp
@@ -79,6 +79,20 @@
#pragma warning( disable : 6001 6221 )
#endif
+#if defined(__MINGW32__) && !defined(MINGW_HAS_SECURE_API)
+
+static inline errno_t
+strcpy_s(char *strDestination, size_t numberOfElements, const char *strSource)
+{
+ strncpy(strDestination, strSource, numberOfElements - 1);
+ if (numberOfElements > 0) {
+ strDestination[numberOfElements - 1] = '\0';
+ }
+ return 0;
+}
+
+#endif
+
//--------------------------------------------------------------------------------------
#define CHK_ERR(hrchk, strOut) \
case hrchk: \