From 9659f22d36acd801fc89f6056ccd846d967ef473 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 1 Jan 2024 18:32:53 -0800 Subject: [PATCH] Don't include os.cc in the module if it is disabled via FMT_OS --- src/fmt.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/fmt.cc b/src/fmt.cc index aa971103..b3d344c6 100644 --- a/src/fmt.cc +++ b/src/fmt.cc @@ -83,6 +83,10 @@ export module fmt; extern "C++" { #endif +#ifndef FMT_OS +# define FMT_OS 1 +#endif + // All library-provided declarations and definitions must be in the module // purview to be exported. #include "fmt/args.h" @@ -90,8 +94,8 @@ extern "C++" { #include "fmt/color.h" #include "fmt/compile.h" #include "fmt/format.h" -#if !defined(FMT_OS) || FMT_OS -# include "fmt/os.h" +#if FMT_OS +# include "fmt/os.h" #endif #include "fmt/printf.h" #include "fmt/std.h" @@ -107,4 +111,6 @@ module :private; #endif #include "format.cc" -#include "os.cc" +#if FMT_OS +# include "os.cc" +#endif \ No newline at end of file