--- ./misc/os_spec.h.orig	2024-10-31 00:50:21.704806000 -0400
+++ ./misc/os_spec.h	2024-10-31 00:50:23.351105000 -0400
@@ -1168,10 +1168,12 @@
   #endif /* OpenBSD safe string functions */
 
   /* Widechar functions */
+#if (!defined(__GNUC__)) || (__GNUC__ < 5) || (!defined(__MINGW32__))
   int mbstowcs_s( size_t *retval, wchar_t *dst, size_t dstmax, 
 				  const char *src, size_t len );
   int wcstombs_s( size_t *retval, char *dst, size_t dstmax, 
 				  const wchar_t *src, size_t len );
+#endif
   #if defined( USE_EMBEDDED_OS )
     /* Support for the thread-safe mbtowc() is practially nonexistent in
 	   embedded OSes, but in any case is unlikely to be necessary since
--- ./misc/int_string.c.orig	2023-02-08 05:06:16.000000000 -0500
+++ ./misc/int_string.c	2024-10-31 00:50:23.355033000 -0400
@@ -475,6 +475,7 @@
 ****************************************************************************/
 
 #ifndef __STDC_LIB_EXT1__
+#if (!defined(__GNUC__)) || (__GNUC__ < 5) || (!defined(__MINGW32__))
 
 /* Minimal wrappers for the TR 24731 functions to map them to older stdlib 
    equivalents.  Because of potential issues when comparing a (signed)
@@ -532,6 +533,7 @@
 	*retval = bytesCopied;
 	return( 0 );
 	}
+#endif
 #endif /* !__STDC_LIB_EXT1__ */
 
 /****************************************************************************
