Refactor SPDLOG_API define
Some checks failed
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[asan:ON build_type:Debug … (push) Failing after 3s
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Debug compiler… (push) Failing after 2s
linux / ${{ matrix.config.compiler}} ${{ matrix.config.version }} (C++${{ matrix.config.cppstd }} ${{ matrix.config.build_type }} ${{ matrix.config.asan == 'ON' && 'ASAN' || '' }}${{ matrix.config.tsan == 'ON' && 'TSAN' || '' }}) (map[build_type:Release compil… (push) Failing after 2s
macos / macOS Clang (C++17, Release) (push) Has been cancelled
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Has been cancelled
windows / build (map[BUILD_EXAMPLE:OFF BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Has been cancelled
windows / build (map[BUILD_EXAMPLE:ON BUILD_SHARED:OFF BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 17 2022]) (push) Has been cancelled
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:17 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Has been cancelled
windows / build_2019 (map[BUILD_EXAMPLE:ON BUILD_SHARED:ON BUILD_TYPE:Release CXX_STANDARD:20 FATAL_ERRORS:ON GENERATOR:Visual Studio 16 2019]) (push) Has been cancelled

This commit is contained in:
gabime 2025-01-18 20:32:34 +02:00
parent 463e41f049
commit 9db0ba648a

View File

@ -18,24 +18,21 @@
#include "fmt/base.h" #include "fmt/base.h"
#include "fmt/xchar.h" #include "fmt/xchar.h"
#if defined(_WIN32) // Define SPDLOG_API according to current build settings
#ifdef SPDLOG_SHARED_LIB #ifndef SPDLOG_SHARED_LIB
#ifdef spdlog_EXPORTS #define SPDLOG_API
#define SPDLOG_API __declspec(dllexport) #elif defined(_WIN32)
#else #ifdef spdlog_EXPORTS
#define SPDLOG_API __declspec(dllimport) #define SPDLOG_API __declspec(dllexport) // Export symbols when building the library
#endif
#else #else
define SPDLOG_API #define SPDLOG_API __declspec(dllimport) // Import symbols when using the library
#endif #endif
#else #elif (defined(__GNUC__) || defined(__clang__))
// in gcc/clang, always set visibility to "default" #define SPDLOG_API __attribute__((visibility("default"))) // Export symbols for shared libraries
#if defined(__GNUC__) || defined(__clang__)
#define SPDLOG_API __attribute__((visibility("default")))
#else #else
#define SPDLOG_API #define SPDLOG_API
#endif #endif
#endif // defined(_WIN32) // End of SPDLOG_API definition
#define SPDLOG_FMT_RUNTIME(format_string) fmt::runtime(format_string) #define SPDLOG_FMT_RUNTIME(format_string) fmt::runtime(format_string)
#define SPDLOG_FMT_STRING(format_string) FMT_STRING(format_string) #define SPDLOG_FMT_STRING(format_string) FMT_STRING(format_string)