Skip to content

Commit 2d0cbd9

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 e511751 commit 2d0cbd9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/base/inc/Riostream.h

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

24+
#ifdef __APPLE__
25+
// ensures _FilesystemClock is defined first
26+
#include <chrono>
27+
#endif
2428
#include <fstream>
2529
#include <iostream>
2630
#include <iomanip>

0 commit comments

Comments
 (0)