Reapply LAMMPS changes to fmtlib

This commit is contained in:
Richard Berger
2021-06-21 11:55:41 -04:00
parent f7752da97f
commit 79cbafd3c7
4 changed files with 15 additions and 6 deletions

View File

@ -18,7 +18,7 @@
// The fmt library version in the form major * 10000 + minor * 100 + patch. // The fmt library version in the form major * 10000 + minor * 100 + patch.
#define FMT_VERSION 80000 #define FMT_VERSION 80000
#ifdef __clang__ #if defined (__clang__ ) && !defined(__ibmxl__)
# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__) # define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
#else #else
# define FMT_CLANG_VERSION 0 # define FMT_CLANG_VERSION 0
@ -218,6 +218,12 @@
# endif # endif
#endif #endif
// LAMMPS customization
// use 'v7_lmp' namespace instead of 'v7' so that our
// bundled copy does not collide with linking other code
// using system wide installations which may be using
// a different version.
#ifndef FMT_BEGIN_NAMESPACE #ifndef FMT_BEGIN_NAMESPACE
# if FMT_USE_INLINE_NAMESPACES # if FMT_USE_INLINE_NAMESPACES
# define FMT_INLINE_NAMESPACE inline namespace # define FMT_INLINE_NAMESPACE inline namespace
@ -228,12 +234,12 @@
# define FMT_INLINE_NAMESPACE namespace # define FMT_INLINE_NAMESPACE namespace
# define FMT_END_NAMESPACE \ # define FMT_END_NAMESPACE \
} \ } \
using namespace v7; \ using namespace v7_lmp; \
} }
# endif # endif
# define FMT_BEGIN_NAMESPACE \ # define FMT_BEGIN_NAMESPACE \
namespace fmt { \ namespace fmt { \
FMT_INLINE_NAMESPACE v7 { FMT_INLINE_NAMESPACE v7_lmp {
#endif #endif
#ifndef FMT_MODULE_EXPORT #ifndef FMT_MODULE_EXPORT
@ -578,10 +584,11 @@ constexpr auto to_string_view(const S& s)
return basic_string_view<typename S::char_type>(s); return basic_string_view<typename S::char_type>(s);
} }
FMT_BEGIN_DETAIL_NAMESPACE // LAMMPS customization using 'v7_lmp' instead of 'v7'
FMT_BEGIN_DETAIL_NAMESPACE
void to_string_view(...); void to_string_view(...);
using fmt::v7::to_string_view; using fmt::v7_lmp::to_string_view;
// Specifies whether S is a string type convertible to fmt::basic_string_view. // Specifies whether S is a string type convertible to fmt::basic_string_view.
// It should be a constexpr function but MSVC 2017 fails to compile it in // It should be a constexpr function but MSVC 2017 fails to compile it in

View File

@ -394,7 +394,7 @@ struct ostream_params {
FMT_END_DETAIL_NAMESPACE FMT_END_DETAIL_NAMESPACE
static constexpr detail::buffer_size buffer_size; static detail::buffer_size buffer_size;
/** A fast output stream which is not thread-safe. */ /** A fast output stream which is not thread-safe. */
class FMT_API ostream final : private detail::buffer<char> { class FMT_API ostream final : private detail::buffer<char> {

View File

@ -1,3 +1,4 @@
// clang-format off
// Formatting library for C++ // Formatting library for C++
// //
// Copyright (c) 2012 - 2016, Victor Zverovich // Copyright (c) 2012 - 2016, Victor Zverovich

View File

@ -1,3 +1,4 @@
// clang-format off
// Formatting library for C++ - optional OS-specific functionality // Formatting library for C++ - optional OS-specific functionality
// //
// Copyright (c) 2012 - 2016, Victor Zverovich // Copyright (c) 2012 - 2016, Victor Zverovich