Skip to content

Commit

Permalink
Fix linkage errors when linking with a shared library (#2011)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Nov 12, 2020
1 parent 9534b9f commit 8898210
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
os: [windows-2016, windows-2019]
platform: [Win32, x64]
build_type: [Debug, Release]
include:
- os: windows-2016
platform: Win32
build_type: Debug
shared: -DBUILD_SHARED_LIBS=ON
exclude:
- os: windows-2016
platform: Win32
Expand All @@ -27,7 +32,7 @@ jobs:
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} \
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.shared}} \
-A ${{matrix.platform}} $GITHUB_WORKSPACE
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ template <typename T> struct decimal_fp {
int exponent;
};

template <typename T> decimal_fp<T> to_decimal(T x) FMT_NOEXCEPT;
template <typename T> FMT_API decimal_fp<T> to_decimal(T x) FMT_NOEXCEPT;
} // namespace dragonbox

template <typename T>
Expand Down
4 changes: 2 additions & 2 deletions src/format.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ int format_float(char* buf, std::size_t size, const char* format, int precision,
: snprintf_ptr(buf, size, format, precision, value);
}

template dragonbox::decimal_fp<float> dragonbox::to_decimal(float x)
template FMT_API dragonbox::decimal_fp<float> dragonbox::to_decimal(float x)
FMT_NOEXCEPT;
template dragonbox::decimal_fp<double> dragonbox::to_decimal(double x)
template FMT_API dragonbox::decimal_fp<double> dragonbox::to_decimal(double x)
FMT_NOEXCEPT;

// DEPRECATED! This function exists for ABI compatibility.
Expand Down

0 comments on commit 8898210

Please sign in to comment.