Skip to content

Commit

Permalink
Refactor exporing in common.h
Browse files Browse the repository at this point in the history
  • Loading branch information
gabime committed Jan 18, 2025
1 parent ace82f7 commit 463e41f
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions include/spdlog/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,24 @@
#include "fmt/base.h"
#include "fmt/xchar.h"

#if defined(SPDLOG_SHARED_LIB)
#if defined(_WIN32)
#if defined(_WIN32)
#ifdef SPDLOG_SHARED_LIB
#ifdef spdlog_EXPORTS
#define SPDLOG_API __declspec(dllexport)
#else // !spdlog_EXPORTS
#else
#define SPDLOG_API __declspec(dllimport)
#endif
#else // !defined(_WIN32)
#define SPDLOG_API __attribute__((visibility("default")))
#endif
#else // !defined(SPDLOG_SHARED_LIB)
#if defined(_WIN32)
#define SPDLOG_API
#else
#define SPDLOG_API __attribute__((visibility("default")))
define SPDLOG_API
#endif
#else
// in gcc/clang, always set visibility to "default"
#if defined(__GNUC__) || defined(__clang__)
#define SPDLOG_API __attribute__((visibility("default")))
#else
#define SPDLOG_API
#endif
#endif // defined(_WIN32)

#define SPDLOG_FMT_RUNTIME(format_string) fmt::runtime(format_string)
#define SPDLOG_FMT_STRING(format_string) FMT_STRING(format_string)
Expand Down

0 comments on commit 463e41f

Please sign in to comment.