Skip to content

Commit

Permalink
fix module test odr violations (#2414)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdacamar authored Jul 17, 2021
1 parent 2038bf6 commit 00235d8
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 00235d8

Please sign in to comment.