diff options
| -rw-r--r-- | include/tag_primitive.h | 14 | ||||
| -rw-r--r-- | src/tag.cpp | 8 |
2 files changed, 15 insertions, 7 deletions
diff --git a/include/tag_primitive.h b/include/tag_primitive.h index 938ec51087..a2da0cfab9 100644 --- a/include/tag_primitive.h +++ b/include/tag_primitive.h @@ -83,13 +83,13 @@ typedef tag_primitive<int64_t> tag_long; typedef tag_primitive<float> tag_float; typedef tag_primitive<double> tag_double; -//Explicit instantiations -template class NBT_EXPORT tag_primitive<int8_t>; -template class NBT_EXPORT tag_primitive<int16_t>; -template class NBT_EXPORT tag_primitive<int32_t>; -template class NBT_EXPORT tag_primitive<int64_t>; -template class NBT_EXPORT tag_primitive<float>; -template class NBT_EXPORT tag_primitive<double>; +//Explicit instantiation declarations +extern template class NBT_EXPORT tag_primitive<int8_t>; +extern template class NBT_EXPORT tag_primitive<int16_t>; +extern template class NBT_EXPORT tag_primitive<int32_t>; +extern template class NBT_EXPORT tag_primitive<int64_t>; +extern template class NBT_EXPORT tag_primitive<float>; +extern template class NBT_EXPORT tag_primitive<double>; template<class T> void tag_primitive<T>::read_payload(io::stream_reader& reader) diff --git a/src/tag.cpp b/src/tag.cpp index 6175a36293..0446dfd3f8 100644 --- a/src/tag.cpp +++ b/src/tag.cpp @@ -32,6 +32,14 @@ namespace nbt { +//Explicit instantiation definitions for tag_primitive +template class tag_primitive<int8_t>; +template class tag_primitive<int16_t>; +template class tag_primitive<int32_t>; +template class tag_primitive<int64_t>; +template class tag_primitive<float>; +template class tag_primitive<double>; + static_assert(std::numeric_limits<float>::is_iec559 && std::numeric_limits<double>::is_iec559, "The floating point values for NBT must conform to IEC 559/IEEE 754"); |
