diff --git a/mingw-w64-v9.0.0-strnlen_s.patch b/mingw-w64-v9.0.0-strnlen_s.patch new file mode 100644 index 0000000..01cdfca --- /dev/null +++ b/mingw-w64-v9.0.0-strnlen_s.patch @@ -0,0 +1,14 @@ +--- mingw-w64-v9.0.0/mingw-w64-headers/crt/sec_api/string_s.h 2021-05-22 14:34:25.000000000 +0200 ++++ mingw-w64-v9.0.0/mingw-w64-headers/crt/sec_api/string_s.h 2021-07-08 09:10:48.082143084 +0200 +@@ -43,9 +43,11 @@ + _CRTIMP errno_t __cdecl strcat_s(char *_Dst, rsize_t _SizeInBytes, const char * _Src); + __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_1(errno_t, strcat_s, char, _Dest, const char *, _Source) + ++#ifdef _NEEDS_STRNLEN_S + __forceinline size_t __cdecl strnlen_s(const char * _src, size_t _count) { + return _src ? strnlen(_src, _count) : 0; + } ++#endif + + _SECIMP errno_t __cdecl memmove_s(void *_dest,size_t _numberOfElements,const void *_src,size_t _count); + #ifndef _WSTRING_S_DEFINED diff --git a/mingw32-headers.changes b/mingw32-headers.changes index 519561f..136e17e 100644 --- a/mingw32-headers.changes +++ b/mingw32-headers.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Jul 8 07:13:22 UTC 2021 - Fridrich Strba + +- Added patch: + * mingw-w64-v9.0.0-strnlen_s.patch + + work around the "multiple definition of `strnlen_s'" error + + the function still accessible by defining _NEEDS_STRNLEN_S + before inclusion of the header + ------------------------------------------------------------------- Fri Jul 2 12:34:00 UTC 2021 - Jan Engelhardt diff --git a/mingw32-headers.spec b/mingw32-headers.spec index 2d4d2a5..7abc7aa 100644 --- a/mingw32-headers.spec +++ b/mingw32-headers.spec @@ -25,6 +25,7 @@ Group: Development/Libraries/C and C++ URL: http://mingw-w64.sf.net/ Source: http://downloads.sf.net/mingw-w64/mingw-w64-v%{version}.tar.bz2 Source1000: %name-rpmlintrc +Patch0: mingw-w64-v9.0.0-strnlen_s.patch BuildRequires: mingw32-filesystem BuildRequires: xz #!BuildIgnore: post-build-checks @@ -49,7 +50,7 @@ and only exist to satisfy dependencies in MinGW's unistd.h until an actual pthread implementation (like winpthreads) is installed. %prep -%autosetup -n mingw-w64-v%version/mingw-w64-headers +%autosetup -n mingw-w64-v%version/mingw-w64-headers -p2 %build %_mingw32_configure \