]> Savannah Git Hosting - gnulib.git/commitdiff
Avoid redefinition errors on MSVC.
authorBruno Haible <bruno@clisp.org>
Sat, 17 Dec 2016 15:44:51 +0000 (16:44 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 17 Dec 2016 22:09:00 +0000 (23:09 +0100)
* m4/snprintf.m4 (gl_REPLACE_SNPRINTF): Set REPLACE_SNPRINTF to 1 if
the function may be defined as an inline function.
* m4/vsnprintf.m4 (gl_REPLACE_VSNPRINTF): Set REPLACE_VSNPRINTF to 1 if
the function may be defined as an inline function.

ChangeLog
m4/snprintf.m4
m4/vsnprintf.m4

index 68912522ecbb2d4c952d38a0159f9eb3d861ce76..1ced537d482234490957bd0e34a468d72b84c523 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-12-17  Bruno Haible  <bruno@clisp.org>
+
+       Avoid redefinition errors on MSVC.
+       * m4/snprintf.m4 (gl_REPLACE_SNPRINTF): Set REPLACE_SNPRINTF to 1 if
+       the function may be defined as an inline function.
+       * m4/vsnprintf.m4 (gl_REPLACE_VSNPRINTF): Set REPLACE_VSNPRINTF to 1 if
+       the function may be defined as an inline function.
+
 2016-12-17  Bruno Haible  <bruno@clisp.org>
 
        Avoid redefinition errors on MSVC.
index f876b559959c00e59b0e23240865ad989bccef94..30aa25c0af04097ed12b675f5ff6aa9d21ec62b3 100644 (file)
@@ -1,4 +1,4 @@
-# snprintf.m4 serial 6
+# snprintf.m4 serial 7
 dnl Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -46,6 +46,14 @@ AC_DEFUN([gl_REPLACE_SNPRINTF],
   AC_LIBOBJ([snprintf])
   if test $ac_cv_func_snprintf = yes; then
     REPLACE_SNPRINTF=1
+  else
+    AC_CHECK_DECLS_ONCE([snprintf])
+    if test $ac_cv_have_decl_snprintf = yes; then
+      dnl If the function is declared but does not appear to exist, it may be
+      dnl defined as an inline function. In order to avoid a conflict, we have
+      dnl to define rpl_snprintf, not snprintf.
+      REPLACE_SNPRINTF=1
+    fi
   fi
   gl_PREREQ_SNPRINTF
 ])
index e056f05cd572286d245bad1e5dc53da311088e2c..02da30834cb9f659f79c11fad0a22acf27c17567 100644 (file)
@@ -1,4 +1,4 @@
-# vsnprintf.m4 serial 6
+# vsnprintf.m4 serial 7
 dnl Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -46,6 +46,14 @@ AC_DEFUN([gl_REPLACE_VSNPRINTF],
   AC_LIBOBJ([vsnprintf])
   if test $ac_cv_func_vsnprintf = yes; then
     REPLACE_VSNPRINTF=1
+  else
+    AC_CHECK_DECLS_ONCE([vsnprintf])
+    if test $ac_cv_have_decl_vsnprintf = yes; then
+      dnl If the function is declared but does not appear to exist, it may be
+      dnl defined as an inline function. In order to avoid a conflict, we have
+      dnl to define rpl_vsnprintf, not vsnprintf.
+      REPLACE_VSNPRINTF=1
+    fi
   fi
   gl_PREREQ_VSNPRINTF
 ])