Skip to content

Commit

Permalink
Don't bring Arg struct into global namespace
Browse files Browse the repository at this point in the history
This fixes compiling fmtlib in header-only mode when user code also has
something called 'Arg' defined. Now qualifying Arg struct with internal
namespace.
  • Loading branch information
Sean LK authored and vitaut committed Mar 8, 2017
1 parent cc736e7 commit e3b5d80
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions fmt/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
# endif
#endif

using fmt::internal::Arg;

#if FMT_EXCEPTIONS
# define FMT_TRY try
# define FMT_CATCH(x) catch (x)
Expand Down Expand Up @@ -455,14 +453,14 @@ void internal::FixedBuffer<Char>::grow(std::size_t) {
FMT_THROW(std::runtime_error("buffer overflow"));
}

FMT_FUNC Arg internal::FormatterBase::do_get_arg(
FMT_FUNC internal::Arg internal::FormatterBase::do_get_arg(
unsigned arg_index, const char *&error) {
Arg arg = args_[arg_index];
internal::Arg arg = args_[arg_index];
switch (arg.type) {
case Arg::NONE:
case internal::Arg::NONE:
error = "argument index out of range";
break;
case Arg::NAMED_ARG:
case internal::Arg::NAMED_ARG:
arg = *static_cast<const internal::Arg*>(arg.pointer);
break;
default:
Expand Down

0 comments on commit e3b5d80

Please sign in to comment.