This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by mstorsjo on Feb 25 2021, 3:11 AM.

Details

Summary

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.

Diff Detail

Event Timeline

mstorsjo requested review of this revision.Feb 25 2021, 3:11 AM
mstorsjo created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 25 2021, 3:11 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald Transcript
curdeius added inline comments.
libcxx/test/support/platform_support.h
60

Would defining VC_EXTRALEAN as well be beneficial and possible?

mstorsjo added inline comments.Feb 25 2021, 4:48 AM
libcxx/test/support/platform_support.h
59–60

The defined(__MINGW32__) here is redundant; _WIN32 is defined in mingw configurations too, will amend the patch to simplify that while touching these lines.

60

That one only seems to have an effect on ATL/MFC headers (I think), which we don't use here. (I hadn't ever heard of that one before actually.) On a MSVC 2019 installation (without ATL/MFC) I get no hits in the headers when grepping for that.

mstorsjo updated this revision to Diff 326361.Feb 25 2021, 4:50 AM
mstorsjo edited the summary of this revision. (Show Details)

Removed the superfluous defined(__MINGW32__).

curdeius accepted this revision as: curdeius.Mar 5 2021, 7:08 AM

LGTM.

Ping for second approval

Quuxplusone accepted this revision.Mar 12 2021, 7:05 AM
Quuxplusone added a subscriber: Quuxplusone.

I don't know much about Windows, but it seems like you know what you're doing. :)

This revision is now accepted and ready to land.Mar 12 2021, 7:05 AM