Enable mkstemp in yacc
authorStephane Glondu <steph@glondu.net>
Thu, 7 Nov 2013 15:06:57 +0000 (16:06 +0100)
committerStéphane Glondu <glondu@debian.org>
Thu, 30 Oct 2014 08:28:06 +0000 (08:28 +0000)
Use the feature test macro found in the mkstemp(3) manpage.

Bug: http://caml.inria.fr/mantis/view.php?id=6232

Gbp-Pq: Name 0011-Enable-mkstemp-in-yacc.patch

yacc/main.c

index f6cac60d45f01b0d57627d013b38d8ad99d30039..66b63ec0efdae293a2324f3225a0cdff068d1740 100644 (file)
@@ -57,6 +57,11 @@ char *verbose_file_name;
 #define HAVE_MKSTEMP
 #endif
 
+#if _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 \
+  || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE >= 200112L
+#define HAVE_MKSTEMP
+#endif
+
 #ifdef HAVE_MKSTEMP
 int action_fd = -1, entry_fd = -1, text_fd = -1, union_fd = -1;
 #endif