Skip to content

Commit 49c4e8c

Browse files
authored
Merge pull request #221 from boostorg/pr/fix-clang-cl-2
Define _CRT_SECURE_NO_WARNINGS instead of using wcscpy_s. Fixes #219.
2 parents e61e5e1 + 65726f3 commit 49c4e8c

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/wide_posix_api.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* DESCRIPTION: Implements the wide character POSIX API wrappers.
1717
*/
1818

19+
#define _CRT_SECURE_NO_WARNINGS // for std::wcscpy
1920
#define BOOST_REGEX_SOURCE
2021

2122
#include <boost/regex/config.hpp>
@@ -169,11 +170,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
169170
{
170171
result = std::wcslen(wnames[code]) + 1;
171172
if(buf_size >= result)
172-
#if (BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)) || (defined(BOOST_CLANG) && defined(_MSC_VER))
173-
::wcscpy_s(buf, buf_size, wnames[code]);
174-
#else
175173
std::wcscpy(buf, wnames[code]);
176-
#endif
177174
return result;
178175
}
179176
return result;
@@ -193,11 +190,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
193190
(boost::core::swprintf)(localbuf, 5, L"%d", i);
194191
#endif
195192
if(std::wcslen(localbuf) < buf_size)
196-
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
197-
::wcscpy_s(buf, buf_size, localbuf);
198-
#else
199193
std::wcscpy(buf, localbuf);
200-
#endif
201194
return std::wcslen(localbuf) + 1;
202195
}
203196
}
@@ -207,11 +200,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
207200
(boost::core::swprintf)(localbuf, 5, L"%d", 0);
208201
#endif
209202
if(std::wcslen(localbuf) < buf_size)
210-
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
211-
::wcscpy_s(buf, buf_size, localbuf);
212-
#else
213203
std::wcscpy(buf, localbuf);
214-
#endif
215204
return std::wcslen(localbuf) + 1;
216205
}
217206
if(code <= (int)REG_E_UNKNOWN)

0 commit comments

Comments
 (0)