[libcxx-commits] [PATCH] D97456: [libcxx] [test] Fix the get_temp_file_name() function for mingw

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 25 03:12:00 PST 2021


mstorsjo created this revision.
mstorsjo added a reviewer: libc++.
mstorsjo requested review of this revision.
Herald added a project: libc++.
Herald added 1 blocking reviewer(s): libc++.

Add the missing includes for getting the defines and functions used in the mingw version of get_temp_file_name().

This fixes 31 tests when built in a mingw configuration.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97456

Files:
  libcxx/test/support/platform_support.h


Index: libcxx/test/support/platform_support.h
===================================================================
--- libcxx/test/support/platform_support.h
+++ libcxx/test/support/platform_support.h
@@ -57,7 +57,9 @@
 #include <locale>
 #include <string>
 #if defined(_WIN32) || defined(__MINGW32__)
+#   define WIN32_LEAN_AND_MEAN // Reduce overhead of including windows.h
 #   include <io.h> // _mktemp_s
+#   include <windows.h> // MAX_PATH, GetTempPath, GetTempFileName
 #else
 #   include <unistd.h> // close
 #endif


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97456.326336.patch
Type: text/x-patch
Size: 523 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210225/5c5e0548/attachment.bin>


More information about the libcxx-commits mailing list