[PATCH] D94707: [Flang] Fix compilation on MinGW-w64

مهدي شينون (Mehdi Chinoune) via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 14 12:10:34 PST 2021


ChinouneMehdi created this revision.
ChinouneMehdi added a project: Flang.
Herald added subscribers: jdoerfert, mstorsjo.
ChinouneMehdi requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94707

Files:
  flang/runtime/file.cpp


Index: flang/runtime/file.cpp
===================================================================
--- flang/runtime/file.cpp
+++ flang/runtime/file.cpp
@@ -14,7 +14,7 @@
 #include <cstring>
 #include <fcntl.h>
 #include <stdlib.h>
-#ifdef _WIN32
+#ifdef _MSC_VER
 #define NOMINMAX
 #include <io.h>
 #include <windows.h>
@@ -31,7 +31,7 @@
 }
 
 static int openfile_mkstemp(IoErrorHandler &handler) {
-#ifdef _WIN32
+#ifdef _MSC_VER
   const unsigned int uUnique{0};
   // GetTempFileNameA needs a directory name < MAX_PATH-14 characters in length.
   // https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettempfilenamea


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94707.316736.patch
Type: text/x-patch
Size: 640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210114/aabf07cc/attachment.bin>


More information about the llvm-commits mailing list