Skip to content

Commit f1d125a

Browse files
jbeshaymeta-codesync[bot]
authored andcommitted
Fix Windows build: add missing #include <string> in test_ext.h
Summary: D91606471 changed test_ext.h to take string_view, replacing #include <string> with #include <string_view>. However, the return type of test_find_resource_t is still std::string, which requires <string>. On GCC/Clang, <string_view> transitively includes <string>, so this went unnoticed on Linux/macOS. On MSVC (Windows), <string_view> does not transitively include <string>, causing the getdeps Windows CI build to fail with: error C2039: 'string': is not a member of 'std'. This adds the missing #include <string> under an #ifdef _WIN32 guard to fix the Windows build. Reviewed By: joanna-jo Differential Revision: D92772665 fbshipit-source-id: 5d8b708ba97eae864bfae4641de7ec37b4e2f82a
1 parent c1b9a3b commit f1d125a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

folly/ext/test_ext.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
#pragma once
1818

19+
#ifdef _WIN32
20+
#include <string>
21+
#endif
1922
#include <string_view>
2023

2124
namespace folly {

0 commit comments

Comments
 (0)