PS: An alternative fix of the problem is to change the body of AC_CHECK_FUNC,
instead of adding a compiler option. Based on this documentation:
<https://learn.microsoft.com/en-us/cpp/intrinsics/compiler-intrinsics>
<https://learn.microsoft.com/en-us/cpp/preprocessor/function-c-cpp>
<https://learn.microsoft.com/en-us/cpp/preprocessor/warning>
<https://learn.microsoft.com/en-us/cpp/preprocessor/pragma-directives-and-the-pragma-keyword>
  */

Roughly like this:

diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 07542d1a..f7a53aec 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -155,7 +155,13 @@ char $2 (void);])], [return $2 ();])])
 #
 m4_define([AC_LANG_FUNC_LINK_TRY(C)],
 [AC_LANG_PROGRAM(
-[/* Define $1 to an innocuous variant, in case <limits.h> declares $1.
+[/* Tell MSVC to forget built-in knowledge about $1.  */
+#ifdef _MSC_VER
+__pragma (warning (suppress : 4163))
+__pragma (function ($1))
+#endif
+
+/* Define $1 to an innocuous variant, in case <limits.h> declares $1.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
 #define $1 innocuous_$1
 




Reply via email to