Merge pull request #3884 from akohlmey/fmtlib-10.1

Update fmtlib to version 10.1
This commit is contained in:
Axel Kohlmeyer
2023-08-14 11:35:29 -04:00
committed by GitHub
11 changed files with 72 additions and 9 deletions

View File

@ -1,7 +1,14 @@
# Settings that the LAMMPS build will import when this package library is used
# See the README file for more explanation
python_SYSINC = $(shell which python-config > /dev/null 2>&1 && python-config --includes || :)
python_SYSLIB = $(shell which python-config > /dev/null 2>&1 && python-config --ldflags --embed > /dev/null 2>&1 && python-config --ldflags --embed || (which python-config > /dev/null 2>&1 && python-config --ldflags || :) )
python_SYSPATH =
ifeq ($(shell type python3 >/dev/null 2>&1; echo $$?), 0)
PYTHON=python3
PYTHONCONFIG = python3-config
else
PYTHONCONFIG = python-config
PYTHON=python
endif
python_SYSINC = $(shell which $(PYTHONCONFIG) > /dev/null 2>&1 && $(PYTHONCONFIG) --includes || :)
python_SYSLIB = $(shell which $(PYTHONCONFIG) > /dev/null 2>&1 && $(PYTHONCONFIG) --ldflags --embed > /dev/null 2>&1 && $(PYTHONCONFIG) --ldflags --embed || (which $(PYTHONCONFIG) > /dev/null 2>&1 && $(PYTHONCONFIG) --ldflags || :) )
python_SYSPATH =

View File

@ -13,11 +13,12 @@
#include <cstring> // std::strlen
#include <iterator>
#include <limits>
#include <memory> // std::addressof
#include <string>
#include <type_traits>
// The fmt library version in the form major * 10000 + minor * 100 + patch.
#define FMT_VERSION 100001
#define FMT_VERSION 100100
#if defined(__clang__) && !defined(__ibmxl__)
# define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__)
@ -1290,9 +1291,9 @@ template <typename Context> class value {
FMT_INLINE value(const named_arg_info<char_type>* args, size_t size)
: named_args{args, size} {}
template <typename T> FMT_CONSTEXPR FMT_INLINE value(T& val) {
template <typename T> FMT_CONSTEXPR20 FMT_INLINE value(T& val) {
using value_type = remove_const_t<T>;
custom.value = const_cast<value_type*>(&val);
custom.value = const_cast<value_type*>(std::addressof(val));
// Get the formatter type through the context to allow different contexts
// have different extension points, e.g. `formatter<T>` for `format` and
// `printf_formatter<T>` for `printf`.
@ -1669,6 +1670,7 @@ template <typename Context> class basic_format_arg {
``vis(value)`` will be called with the value of type ``double``.
\endrst
*/
// DEPRECATED!
FMT_EXPORT
template <typename Visitor, typename Context>
FMT_CONSTEXPR FMT_INLINE auto visit_format_arg(

View File

@ -920,7 +920,7 @@ class basic_memory_buffer final : public detail::buffer<T> {
private:
T store_[SIZE];
// Don't inherit from Allocator avoid generating type_info for it.
// Don't inherit from Allocator to avoid generating type_info for it.
FMT_NO_UNIQUE_ADDRESS Allocator alloc_;
// Deallocate memory allocated by the buffer.
@ -3178,7 +3178,8 @@ FMT_CONSTEXPR20 inline void format_dragon(basic_fp<uint128_t> value,
}
if (buf[0] == overflow) {
buf[0] = '1';
++exp10;
if ((flags & dragon::fixed) != 0) buf.push_back('0');
else ++exp10;
}
return;
}

View File

@ -8,6 +8,7 @@
#ifndef FMT_STD_H_
#define FMT_STD_H_
#include <bitset>
#include <cstdlib>
#include <exception>
#include <memory>
@ -15,6 +16,7 @@
#include <type_traits>
#include <typeinfo>
#include <utility>
#include <vector>
#include "format.h"
#include "ostream.h"
@ -389,6 +391,50 @@ struct formatter<
#endif
}
};
namespace detail {
template <typename T, typename Enable = void>
struct has_flip : std::false_type {};
template <typename T>
struct has_flip<T, void_t<decltype(std::declval<T>().flip())>>
: std::true_type {};
template <typename T> struct is_bit_reference_like {
static constexpr const bool value =
std::is_convertible<T, bool>::value &&
std::is_nothrow_assignable<T, bool>::value && has_flip<T>::value;
};
#ifdef _LIBCPP_VERSION
// Workaround for libc++ incompatibility with C++ standard.
// According to the Standard, `bitset::operator[] const` returns bool.
template <typename C>
struct is_bit_reference_like<std::__bit_const_reference<C>> {
static constexpr const bool value = true;
};
#endif
} // namespace detail
// We can't use std::vector<bool, Allocator>::reference and
// std::bitset<N>::reference because the compiler can't deduce Allocator and N
// in partial specialization.
FMT_EXPORT
template <typename BitRef, typename Char>
struct formatter<BitRef, Char,
enable_if_t<detail::is_bit_reference_like<BitRef>::value>>
: formatter<bool, Char> {
template <typename FormatContext>
FMT_CONSTEXPR auto format(const BitRef& v, FormatContext& ctx) const
-> decltype(ctx.out()) {
return formatter<bool, Char>::format(v, ctx);
}
};
FMT_END_NAMESPACE
#endif // FMT_STD_H_

View File

@ -54,6 +54,7 @@ From: ubuntu:20.04
python3-setuptools \
python3-virtualenv \
python3-venv \
python-is-python3 \
rsync \
ssh \
texlive \

View File

@ -83,6 +83,7 @@ From: ubuntu:20.04
python3-setuptools \
python3-virtualenv \
python3-venv \
python-is-python3 \
rsync \
ssh \
vim-nox \

View File

@ -88,6 +88,7 @@ From: ubuntu:20.04
python3-setuptools \
python3-virtualenv \
python3-venv \
python-is-python3 \
rsync \
ssh \
vim-nox \

View File

@ -53,6 +53,7 @@ From: ubuntu:20.04
python3-setuptools \
python3-virtualenv \
python3-venv \
python-is-python3 \
rsync \
ssh \
vim-nox \

View File

@ -56,6 +56,7 @@ From: nvidia/cuda:11.6.2-devel-ubuntu20.04
python3-setuptools \
python3-virtualenv \
python3-venv \
python-is-python3 \
rsync \
ssh \
vim-nox \

View File

@ -52,6 +52,7 @@ From: ubuntu:20.04
python3-setuptools \
python3-virtualenv \
python3-venv \
python-is-python3 \
rsync \
ssh \
texlive \

View File

@ -54,6 +54,7 @@ From: ubuntu:22.04
python3-setuptools \
python3-virtualenv \
python3-venv \
python-is-python3 \
rsync \
ssh \
texlive \