summaryrefslogtreecommitdiff
path: root/libgfortran/acinclude.m4
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-23 13:03:35 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-23 13:03:35 +0000
commit3b99ec70a69f55388d8cf2f8e433ee93f5edbaa5 (patch)
tree9abbc0a4bb0fdbe3f645d62bc422147e4a4c80db /libgfortran/acinclude.m4
parent81a1889553d10bcb8b160ba45ac4d99e8cf0eae6 (diff)
downloadgcc-3b99ec70a69f55388d8cf2f8e433ee93f5edbaa5.tar.gz
PR libfortran/23138
* acinclude.m4 (LIBGFOR_CHECK_MINGW_SNPRINTF): New check. * configure.ac: Use LIBGFOR_CHECK_MINGW_SNPRINTF. * libgfortran.h: If HAVE_MINGW_SNPRINTF is true, use __mingw_snprintf instead of snprintf. * config.h.in: Regenerate. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127739 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/acinclude.m4')
-rw-r--r--libgfortran/acinclude.m416
1 files changed, 16 insertions, 0 deletions
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
index 1270a98c04e..40ce53560b3 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -386,3 +386,19 @@ AC_DEFUN([LIBGFOR_CHECK_FPSETMASK], [
AC_DEFINE(HAVE_FPSETMASK, 1, [Define if you have fpsetmask.])
fi
])
+
+dnl Check whether we have a mingw that provides a __mingw_snprintf function
+AC_DEFUN([LIBGFOR_CHECK_MINGW_SNPRINTF], [
+ AC_CACHE_CHECK([whether __mingw_snprintf is present], have_mingw_snprintf, [
+ AC_TRY_LINK([
+#include <stdio.h>
+extern int __mingw_snprintf (char *, size_t, const char *, ...);
+],[
+__mingw_snprintf (NULL, 0, "%d\n", 1);
+],
+ eval "have_mingw_snprintf=yes", eval "have_mingw_snprintf=no")
+ ])
+ if test x"$have_mingw_snprintf" = xyes; then
+ AC_DEFINE(HAVE_MINGW_SNPRINTF, 1, [Define if you have __mingw_snprintf.])
+ fi
+])