Mercurial > gnulib
annotate m4/tmpfile.m4 @ 40057:b06060465f09
maint: Run 'make update-copyright'
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 01 Jan 2019 00:25:11 +0100 |
parents | beb2ad957aca |
children | 5c7e0484c1e9 |
rev | line source |
---|---|
19595
beb2ad957aca
Simplify code. Drop support for Borland C++ on Windows.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
1 # tmpfile.m4 serial 3 |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19595
diff
changeset
|
2 # Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc. |
8162 | 3 # This file is free software; the Free Software Foundation |
4 # gives unlimited permission to copy and/or distribute it, | |
5 # with or without modifications, as long as this notice is preserved. | |
6 | |
7 # Written by Ben Pfaff. | |
8 | |
13137
fd3c9fa89efe
tmpfile: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
9 # Check whether to use a replacement tmpfile() function. |
fd3c9fa89efe
tmpfile: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
10 |
8162 | 11 # The native Windows tmpfile function always tries to put the temporary |
12 # file in the root directory. (This behaviour is even documented in | |
13 # Microsoft's documentation!) This often fails for ordinary users who | |
14 # don't have the permissions to write in the root directory. | |
15 # | |
16 # We can't test for tmpfile even at runtime, since our test program | |
17 # might be running with privileges that allow it to write to the root | |
18 # directory, even though tmpfile wouldn't work in general. Instead, | |
19 # just test for a Windows platform (excluding Cygwin). | |
20 | |
13138 | 21 AC_DEFUN([gl_FUNC_TMPFILE], [ |
13137
fd3c9fa89efe
tmpfile: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
22 AC_REQUIRE([gl_STDIO_H_DEFAULTS]) |
8162 | 23 AC_CACHE_CHECK([whether tmpfile should be overridden], |
24 [gl_cv_func_tmpfile_unusable], | |
25 [AC_EGREP_CPP([choke me], [ | |
19595
beb2ad957aca
Simplify code. Drop support for Borland C++ on Windows.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
26 #if defined _WIN32 && !defined __CYGWIN__ |
8162 | 27 choke me |
28 #endif | |
29 ], | |
30 [gl_cv_func_tmpfile_unusable=yes], | |
31 [gl_cv_func_tmpfile_unusable=no])]) | |
32 if test $gl_cv_func_tmpfile_unusable = yes; then | |
13137
fd3c9fa89efe
tmpfile: Fix C++ test error on mingw.
Bruno Haible <bruno@clisp.org>
parents:
12559
diff
changeset
|
33 REPLACE_TMPFILE=1 |
8162 | 34 fi |
35 ]) | |
36 | |
37 # Prerequisites of lib/tmpfile.c. | |
38 AC_DEFUN([gl_PREREQ_TMPFILE], [:]) |