Skip to content
forked from fmtlib/fmt

Commit

Permalink
Merge pull request #78 from fmtlib/master
Browse files Browse the repository at this point in the history
Fix symbol visibility on Linux when compiling with -fvisibility=hidde…
  • Loading branch information
sthagen authored Jan 30, 2020
2 parents 5aff30f + 314e150 commit 666d983
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion include/fmt/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,20 @@
# define FMT_CLASS_API
#endif
#ifndef FMT_API
# define FMT_API
# if FMT_GCC_VERSION || FMT_CLANG_VERSION
# define FMT_API __attribute__((visibility("default")))
# define FMT_EXTERN_TEMPLATE_API FMT_API
# define FMT_INSTANTIATION_DEF_API
# else
# define FMT_API
# endif
#endif
#ifndef FMT_EXTERN_TEMPLATE_API
# define FMT_EXTERN_TEMPLATE_API
#endif
#ifndef FMT_INSTANTIATION_DEF_API
# define FMT_INSTANTIATION_DEF_API FMT_API
#endif

#ifndef FMT_HEADER_ONLY
# define FMT_EXTERN extern
Expand Down
2 changes: 1 addition & 1 deletion src/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ template FMT_API char* internal::sprintf_format(long double,
internal::buffer<char>&,
sprintf_specs);

template struct FMT_API internal::basic_data<void>;
template struct FMT_INSTANTIATION_DEF_API internal::basic_data<void>;

// Workaround a bug in MSVC2013 that prevents instantiation of format_float.
int (*instantiate_format_float)(double, int, internal::float_specs,
Expand Down

0 comments on commit 666d983

Please sign in to comment.