From 4ccbe4b5f29c5ed819620101026e501c7f9bd953 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Wed, 15 Jan 2020 08:05:58 -0700 Subject: [PATCH] Avoid namespace clash for fmt ## Problem In the case of an existing `fmt` namespace (in my project this looks like `Project::fmt`) it is possible to get a namespace clash in debug builds (MSVC 2017) ## Proposed Solution When referencing `fmt` internally, be explicit that it is relative to the global namespace using `::fmt` --- include/fmt/core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 129569a0..4a777f75 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -253,7 +253,7 @@ FMT_API void assert_fail(const char* file, int line, const char* message); # define FMT_ASSERT(condition, message) \ ((condition) \ ? void() \ - : fmt::internal::assert_fail(__FILE__, __LINE__, (message))) + : ::fmt::internal::assert_fail(__FILE__, __LINE__, (message))) # endif #endif