Skip to content

Commit 22a4948

Browse files
committed
[macOS] Include <chrono> to fix _FilesystemClock build warning
Including <chrono> first forces the private clock module to be imported before <fstream> transitively includes <filesystem> Fixes the warning: ``` [79/2727] Generating G__Core.cxx, ../lib/Core.pcm In module 'std' imported from input_line_1:1: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/usr/include/c++/v1/__chrono/time_point.h:33:52: error: definition of '_FilesystemClock' must be imported from module 'std.std_private_chrono_file_clock' before it is required template <class _Clock, class _Duration = typename _Clock::duration> ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/usr/include/c++/v1/__chrono/time_point.h:33:1: note: in instantiation of default argument for 'time_point<std::filesystem::_FilesystemClock>' required here template <class _Clock, class _Duration = typename _Clock::duration> ^~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/usr/include/c++/v1/__chrono/file_clock.h:49:8: note: definition here is not reachable struct _FilesystemClock { ```
1 parent ce0f0af commit 22a4948

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/base/inc/Riostream.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
// //
2222
//////////////////////////////////////////////////////////////////////////
2323

24+
#ifdef __APPLE__
25+
// Workaround for https://github.com/llvm/llvm-project/issues/138683
26+
// Include <chrono> before <fstream> to ensure _FilesystemClock is defined
27+
// Can be removed once the upstream issue is fixed.
28+
#include <chrono>
29+
#endif
2430
#include <fstream>
2531
#include <iostream>
2632
#include <iomanip>

0 commit comments

Comments
 (0)