summaryrefslogtreecommitdiffstats
path: root/libgfortran/libgfortran.h
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/libgfortran.h')
-rw-r--r--libgfortran/libgfortran.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index 7d9aca1cb72..6cccacadabe 100644
--- a/libgfortran/libgfortran.h
+++ b/libgfortran/libgfortran.h
@@ -119,6 +119,10 @@ extern int __mingw_snprintf (char *, size_t, const char *, ...)
__attribute__ ((format (gnu_printf, 3, 4)));
#undef snprintf
#define snprintf __mingw_snprintf
+/* Fallback to sprintf if target does not have snprintf. */
+#elif !defined(HAVE_SNPRINTF)
+#undef snprintf
+#define snprintf(str, size, ...) sprintf (str, __VA_ARGS__)
#endif
OpenPOWER on IntegriCloud