Guard more system headers by FMT_MODULE (#4006)

* Guard more system headers by `FMT_MODULE`

* Merge FMT_MODULE and FMT_IMPORT_STD
This commit is contained in:
LoveSy
2024-06-15 01:53:51 +08:00
committed by GitHub
parent 98dd673cf8
commit 8687315e86
14 changed files with 69 additions and 65 deletions

View File

@@ -8,19 +8,19 @@
#ifndef FMT_BASE_H_
#define FMT_BASE_H_
#if defined(FMT_IMPORT_STD) && !defined(FMT_MODULE)
# define FMT_MODULE
#endif
// c headers are preferable for performance reasons
#ifndef FMT_MODULE
# include <limits.h> // CHAR_BIT
# include <stdio.h> // FILE
# include <string.h> // strlen
#endif
#ifndef FMT_IMPORT_STD
// <cstddef> is also included transitively from <type_traits>.
# include <cstddef> // std::byte
# include <type_traits> // std::enable_if
#else
import std;
#endif
// The fmt library version in the form major * 10000 + minor * 100 + patch.