summaryrefslogtreecommitdiff
path: root/gnulib/m4/tmpfile.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gnulib/m4/tmpfile.m4')
m---------gnulib0
-rw-r--r--gnulib/m4/tmpfile.m438
2 files changed, 38 insertions, 0 deletions
diff --git a/gnulib b/gnulib
deleted file mode 160000
-Subproject 443bc5ffcf7429e557f4a371b0661abe98ddbc1
diff --git a/gnulib/m4/tmpfile.m4 b/gnulib/m4/tmpfile.m4
new file mode 100644
index 0000000..a0b8be7
--- /dev/null
+++ b/gnulib/m4/tmpfile.m4
@@ -0,0 +1,38 @@
+# tmpfile.m4 serial 2
+# Copyright (C) 2007, 2009-2011 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Ben Pfaff.
+
+# Check whether to use a replacement tmpfile() function.
+
+# The native Windows tmpfile function always tries to put the temporary
+# file in the root directory. (This behaviour is even documented in
+# Microsoft's documentation!) This often fails for ordinary users who
+# don't have the permissions to write in the root directory.
+#
+# We can't test for tmpfile even at runtime, since our test program
+# might be running with privileges that allow it to write to the root
+# directory, even though tmpfile wouldn't work in general. Instead,
+# just test for a Windows platform (excluding Cygwin).
+
+AC_DEFUN([gl_FUNC_TMPFILE], [
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_CACHE_CHECK([whether tmpfile should be overridden],
+ [gl_cv_func_tmpfile_unusable],
+ [AC_EGREP_CPP([choke me], [
+#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+choke me
+#endif
+ ],
+ [gl_cv_func_tmpfile_unusable=yes],
+ [gl_cv_func_tmpfile_unusable=no])])
+ if test $gl_cv_func_tmpfile_unusable = yes; then
+ REPLACE_TMPFILE=1
+ fi
+])
+
+# Prerequisites of lib/tmpfile.c.
+AC_DEFUN([gl_PREREQ_TMPFILE], [:])