summaryrefslogtreecommitdiff
path: root/w32/compat
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-10-07 19:14:01 +0300
committerEli Zaretskii <eliz@gnu.org>2013-10-07 19:14:01 +0300
commitb69b04dc8cdbadbf8933f5f317a1cc8bc5c1eb60 (patch)
treed1fec8a00031d743b973bcf9e0d3c49b3c89cd42 /w32/compat
parentb539908f7363af9a4c767c999c389f1c6f311648 (diff)
downloadgunmake-b69b04dc8cdbadbf8933f5f317a1cc8bc5c1eb60.tar.gz
Foix compilation with MSVC.
w32/compat/posixfcn.c (tmpfile): Move declaration of h before the first executable statement. Reported by Gisle Vanem <gvanem@yahoo.no>.
Diffstat (limited to 'w32/compat')
-rw-r--r--w32/compat/posixfcn.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/w32/compat/posixfcn.c b/w32/compat/posixfcn.c
index 0ebf9a6..560110f 100644
--- a/w32/compat/posixfcn.c
+++ b/w32/compat/posixfcn.c
@@ -301,19 +301,21 @@ tmpfile (void)
path_size + sizemax < sizeof temp_path &&
!(uniq >= 0x10000 && second_loop))
{
+ HANDLE h;
+
sprintf (temp_path + path_size,
"%s%s%u-%x.tmp",
temp_path[path_size - 1] == '\\' ? "" : "\\",
base, pid, uniq);
- HANDLE h = CreateFile (temp_path, /* file name */
- GENERIC_READ | GENERIC_WRITE | DELETE, /* desired access */
- FILE_SHARE_READ | FILE_SHARE_WRITE, /* share mode */
- NULL, /* default security attributes */
- CREATE_NEW, /* creation disposition */
- FILE_ATTRIBUTE_NORMAL | /* flags and attributes */
- FILE_ATTRIBUTE_TEMPORARY |
- FILE_FLAG_DELETE_ON_CLOSE,
- NULL); /* no template file */
+ h = CreateFile (temp_path, /* file name */
+ GENERIC_READ | GENERIC_WRITE | DELETE, /* desired access */
+ FILE_SHARE_READ | FILE_SHARE_WRITE, /* share mode */
+ NULL, /* default security attributes */
+ CREATE_NEW, /* creation disposition */
+ FILE_ATTRIBUTE_NORMAL | /* flags and attributes */
+ FILE_ATTRIBUTE_TEMPORARY |
+ FILE_FLAG_DELETE_ON_CLOSE,
+ NULL); /* no template file */
if (h == INVALID_HANDLE_VALUE)
{