[libcxx-commits] [libcxx] d07e5c2 - [libcxx] [test] Fix the get_temp_file_name() function for mingw

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 15 09:53:02 PDT 2021


Author: Martin Storsjö
Date: 2021-03-15T18:52:49+02:00
New Revision: d07e5c23b40078dcae13f76b091c9e18763ae44a

URL: https://github.com/llvm/llvm-project/commit/d07e5c23b40078dcae13f76b091c9e18763ae44a
DIFF: https://github.com/llvm/llvm-project/commit/d07e5c23b40078dcae13f76b091c9e18763ae44a.diff

LOG: [libcxx] [test] Fix the get_temp_file_name() function for mingw

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.

Also remove a redundant ifdef; _WIN32 is defined in mingw targets too.

Differential Revision: https://reviews.llvm.org/D97456

Added: 
    

Modified: 
    libcxx/test/support/platform_support.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/support/platform_support.h b/libcxx/test/support/platform_support.h
index 9290dbd7b76b..d348221c86a7 100644
--- a/libcxx/test/support/platform_support.h
+++ b/libcxx/test/support/platform_support.h
@@ -56,8 +56,10 @@
 #include <codecvt>
 #include <locale>
 #include <string>
-#if defined(_WIN32) || defined(__MINGW32__)
+#if defined(_WIN32)
+#   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


        


More information about the libcxx-commits mailing list