--- libfido2-1.16.0/CMakeLists.txt.orig	2025-07-11 12:16:37.586223100 +0200
+++ libfido2-1.16.0/CMakeLists.txt	2025-07-11 12:18:25.434110500 +0200
@@ -262,13 +262,6 @@
 		set(NFC_LINUX OFF)
 	endif()
 
-	if(MINGW)
-		# MinGW is stuck with a flavour of C89.
-		add_definitions(-DFIDO_NO_DIAGNOSTIC)
-		add_definitions(-DWC_ERR_INVALID_CHARS=0x80)
-		add_compile_options(-Wno-unused-parameter)
-	endif()
-
 	if(FUZZ)
 		set(USE_PCSC ON)
 		add_definitions(-DFIDO_FUZZ)
--- libfido2-1.16.0/openbsd-compat/openbsd-compat.h.orig	2025-05-06 08:40:51.000000000 +0200
+++ libfido2-1.16.0/openbsd-compat/openbsd-compat.h	2025-07-11 12:19:36.858477500 +0200
@@ -104,7 +104,7 @@
 ssize_t getline(char **, size_t *, FILE *);
 #endif
 
-#if defined(_MSC_VER)
+#if defined(WIN32)
 #define strerror_r(e, b, l) strerror_s((b), (l), (e))
 #endif
 
--- libfido2-1.16.0/src/extern.h.orig	2025-05-06 08:40:51.000000000 +0200
+++ libfido2-1.16.0/src/extern.h	2025-07-11 12:29:41.337077600 +0200
@@ -164,7 +164,15 @@
 #define fido_log_xxd(...)	do { /* nothing */ } while (0)
 #define fido_log_error(...)	do { /* nothing */ } while (0)
 #else
-#ifdef __GNUC__
+#ifdef __MINGW32__
+void fido_log_init(void);
+void fido_log_debug(const char *, ...)
+    __MINGW_GNU_PRINTF (1, 2);
+void fido_log_xxd(const void *, size_t, const char *, ...)
+    __MINGW_GNU_PRINTF (3, 4);
+void fido_log_error(int, const char *, ...)
+    __MINGW_GNU_PRINTF (2, 3);
+#elif defined(__GNUC__)
 void fido_log_init(void);
 void fido_log_debug(const char *, ...)
     __attribute__((__format__ (printf, 1, 2)));
