Skip to content
forked from fmtlib/fmt

Commit

Permalink
Merge pull request #208 from fmtlib/master
Browse files Browse the repository at this point in the history
fix module test odr violations (fmtlib#2414)
  • Loading branch information
sthagen authored Jul 17, 2021
2 parents 2287fff + 00235d8 commit 50b2868
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/gtest-extra.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@

#include <string>

#ifdef FMT_MODULE_TEST
import fmt;
#else
#include "fmt/os.h"
#endif // FMG_MODULE_TEST

#include "gmock/gmock.h"

#define FMT_TEST_THROW_(statement, expected_exception, expected_message, fail) \
Expand Down
2 changes: 2 additions & 0 deletions test/module-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# define FMT_HIDE_MODULE_BUGS
#endif

#define FMT_MODULE_TEST

#include <bit>
#include <chrono>
#include <exception>
Expand Down
4 changes: 4 additions & 0 deletions test/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
#include <locale>
#include <string>

#ifdef FMT_MODULE_TEST
import fmt;
#else
#include "fmt/os.h"
#endif // FMT_MODULE_TEST

#ifdef _MSC_VER
# define FMT_VSNPRINTF vsprintf_s
Expand Down

0 comments on commit 50b2868

Please sign in to comment.