Add a missing include for the C++ module build (#4868)

The std.h header uses types such as std::atomic and std::atomic_flag.
For the normal build mode, this header does include all the
headers it needs, such as <atomic>.

However when building the C++ module of {fmt}, the std.h header
omits such includes, and instead expects them to be included
beforehand by fmt.cc - which lacked including <atomic>.

This fixes building the C++ module with libc++ 23, which has removed
a number of unnecessary transitive includes.
This commit is contained in:
Martin Storsjö 2026-07-29 21:23:12 +02:00 committed by GitHub
parent c0330b7466
commit 758d39eb23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,7 @@ module;
// to prevent attachment to this module. // to prevent attachment to this module.
#ifndef FMT_IMPORT_STD #ifndef FMT_IMPORT_STD
# include <algorithm> # include <algorithm>
# include <atomic>
# include <bitset> # include <bitset>
# include <chrono> # include <chrono>
# include <cmath> # include <cmath>