|
122 | 122 | #endif |
123 | 123 |
|
124 | 124 | #if !defined(_MSC_VER) || defined(__clang__) |
125 | | -/* adequate compilers */ |
126 | | -#define MDBX_EXTERN_API_TEMPLATE(API_ATTRIBUTES, API_TYPENAME) extern template class API_ATTRIBUTES API_TYPENAME |
127 | | -#define MDBX_INSTALL_API_TEMPLATE(API_ATTRIBUTES, API_TYPENAME) template class API_TYPENAME |
| 125 | +#define MDBX_EXTERN_API_TEMPLATE(API_ATTRIBUTES, ...) extern template class API_ATTRIBUTES __VA_ARGS__ |
| 126 | +#define MDBX_INSTALL_API_TEMPLATE(API_ATTRIBUTES, ...) template class __VA_ARGS__ |
128 | 127 | #else |
129 | | -/* stupid microsoft showing off */ |
130 | | -#define MDBX_EXTERN_API_TEMPLATE(API_ATTRIBUTES, API_TYPENAME) extern template class API_TYPENAME |
131 | | -#define MDBX_INSTALL_API_TEMPLATE(API_ATTRIBUTES, API_TYPENAME) template class API_ATTRIBUTES API_TYPENAME |
| 128 | +#define MDBX_EXTERN_API_TEMPLATE(API_ATTRIBUTES, ...) extern template class __VA_ARGS__ |
| 129 | +#define MDBX_INSTALL_API_TEMPLATE(API_ATTRIBUTES, ...) template class API_ATTRIBUTES __VA_ARGS__ |
132 | 130 | #endif |
133 | 131 |
|
134 | 132 | #if __cplusplus >= 201103L |
@@ -1243,7 +1241,7 @@ struct LIBMDBX_API to_hex { |
1243 | 1241 | /// \brief Returns a buffer with a hexadecimal dump of a passed slice. |
1244 | 1242 | template <class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy> |
1245 | 1243 | buffer<ALLOCATOR, CAPACITY_POLICY> as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const { |
1246 | | - return make_buffer<ALLOCATOR>(*this, allocator); |
| 1244 | + return make_buffer<ALLOCATOR, CAPACITY_POLICY>(*this, allocator); |
1247 | 1245 | } |
1248 | 1246 |
|
1249 | 1247 | /// \brief Returns the buffer size in bytes needed for hexadecimal |
@@ -1291,7 +1289,7 @@ struct LIBMDBX_API to_base58 { |
1291 | 1289 | /// [Base58](https://en.wikipedia.org/wiki/Base58) dump of a passed slice. |
1292 | 1290 | template <class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy> |
1293 | 1291 | buffer<ALLOCATOR, CAPACITY_POLICY> as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const { |
1294 | | - return make_buffer<ALLOCATOR>(*this, allocator); |
| 1292 | + return make_buffer<ALLOCATOR, CAPACITY_POLICY>(*this, allocator); |
1295 | 1293 | } |
1296 | 1294 |
|
1297 | 1295 | /// \brief Returns the buffer size in bytes needed for |
@@ -1337,7 +1335,7 @@ struct LIBMDBX_API to_base64 { |
1337 | 1335 | /// [Base64](https://en.wikipedia.org/wiki/Base64) dump of a passed slice. |
1338 | 1336 | template <class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy> |
1339 | 1337 | buffer<ALLOCATOR, CAPACITY_POLICY> as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const { |
1340 | | - return make_buffer<ALLOCATOR>(*this, allocator); |
| 1338 | + return make_buffer<ALLOCATOR, CAPACITY_POLICY>(*this, allocator); |
1341 | 1339 | } |
1342 | 1340 |
|
1343 | 1341 | /// \brief Returns the buffer size in bytes needed for |
@@ -1388,7 +1386,7 @@ struct LIBMDBX_API from_hex { |
1388 | 1386 | /// \brief Decodes hexadecimal dump from a passed slice to returned buffer. |
1389 | 1387 | template <class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy> |
1390 | 1388 | buffer<ALLOCATOR, CAPACITY_POLICY> as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const { |
1391 | | - return make_buffer<ALLOCATOR>(*this, allocator); |
| 1389 | + return make_buffer<ALLOCATOR, CAPACITY_POLICY>(*this, allocator); |
1392 | 1390 | } |
1393 | 1391 |
|
1394 | 1392 | /// \brief Returns the number of bytes needed for conversion |
@@ -1428,7 +1426,7 @@ struct LIBMDBX_API from_base58 { |
1428 | 1426 | /// passed slice to returned buffer. |
1429 | 1427 | template <class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy> |
1430 | 1428 | buffer<ALLOCATOR, CAPACITY_POLICY> as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const { |
1431 | | - return make_buffer<ALLOCATOR>(*this, allocator); |
| 1429 | + return make_buffer<ALLOCATOR, CAPACITY_POLICY>(*this, allocator); |
1432 | 1430 | } |
1433 | 1431 |
|
1434 | 1432 | /// \brief Returns the number of bytes needed for conversion |
@@ -1471,7 +1469,7 @@ struct LIBMDBX_API from_base64 { |
1471 | 1469 | /// passed slice to returned buffer. |
1472 | 1470 | template <class ALLOCATOR = default_allocator, typename CAPACITY_POLICY = default_capacity_policy> |
1473 | 1471 | buffer<ALLOCATOR, CAPACITY_POLICY> as_buffer(const ALLOCATOR &allocator = ALLOCATOR()) const { |
1474 | | - return make_buffer<ALLOCATOR>(*this, allocator); |
| 1472 | + return make_buffer<ALLOCATOR, CAPACITY_POLICY>(*this, allocator); |
1475 | 1473 | } |
1476 | 1474 |
|
1477 | 1475 | /// \brief Returns the number of bytes needed for conversion |
@@ -2838,11 +2836,13 @@ inline string<ALLOCATOR> make_string(const PRODUCER &producer, const ALLOCATOR & |
2838 | 2836 | return result; |
2839 | 2837 | } |
2840 | 2838 |
|
2841 | | -MDBX_EXTERN_API_TEMPLATE(LIBMDBX_API_TYPE, buffer<legacy_allocator>); |
| 2839 | +#if !(defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)) || defined(LIBMDBX_EXPORTS) |
| 2840 | +MDBX_EXTERN_API_TEMPLATE(LIBMDBX_API_TYPE, buffer<legacy_allocator, default_capacity_policy>); |
2842 | 2841 |
|
2843 | 2842 | #if MDBX_CXX_HAS_POLYMORPHIC_ALLOCATOR |
2844 | | -MDBX_EXTERN_API_TEMPLATE(LIBMDBX_API_TYPE, buffer<polymorphic_allocator>); |
| 2843 | +MDBX_EXTERN_API_TEMPLATE(LIBMDBX_API_TYPE, buffer<polymorphic_allocator, default_capacity_policy>); |
2845 | 2844 | #endif /* MDBX_CXX_HAS_POLYMORPHIC_ALLOCATOR */ |
| 2845 | +#endif /* !MinGW || MDBX_EXPORTS */ |
2846 | 2846 |
|
2847 | 2847 | /// \brief Combines data slice with boolean flag to represent result of certain operations. |
2848 | 2848 | struct value_result { |
|
0 commit comments