From c130fc12c04018b15916b7d872f9a6621506ebe2 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 10 Aug 2026 19:56:15 +1000 Subject: [PATCH] dep/fmt: Update to v12.2.0 --- dep/fmt/CMakeLists.txt | 641 ++++++----- dep/fmt/ChangeLog.md | 223 ++++ dep/fmt/LICENSE | 7 - dep/fmt/README.md | 177 +-- dep/fmt/include/fmt/args.h | 12 +- dep/fmt/include/fmt/base.h | 576 +++++----- dep/fmt/include/fmt/chrono.h | 39 +- dep/fmt/include/fmt/color.h | 46 +- dep/fmt/include/fmt/compile.h | 63 +- dep/fmt/include/fmt/core.h | 17 +- dep/fmt/include/fmt/fmt-c.h | 201 ++++ dep/fmt/include/fmt/format-inl.h | 1394 ++++++++++++------------ dep/fmt/include/fmt/format.h | 345 +++--- dep/fmt/include/fmt/os.h | 10 +- dep/fmt/include/fmt/ostream.h | 6 +- dep/fmt/include/fmt/printf.h | 45 +- dep/fmt/include/fmt/ranges.h | 86 +- dep/fmt/include/fmt/std.h | 101 +- dep/fmt/include/fmt/xchar.h | 71 +- dep/fmt/src/fmt-c.cc | 67 ++ dep/fmt/src/fmt.cc | 12 +- dep/fmt/src/format.cc | 2 +- dep/fmt/src/os.cc | 41 +- dep/fmt/support/cmake/FindSetEnv.cmake | 8 +- dep/fmt/support/cmake/JoinPaths.cmake | 36 +- 25 files changed, 2431 insertions(+), 1795 deletions(-) create mode 100644 dep/fmt/include/fmt/fmt-c.h create mode 100644 dep/fmt/src/fmt-c.cc diff --git a/dep/fmt/CMakeLists.txt b/dep/fmt/CMakeLists.txt index 3c0551323..ee568cec2 100644 --- a/dep/fmt/CMakeLists.txt +++ b/dep/fmt/CMakeLists.txt @@ -1,16 +1,16 @@ cmake_minimum_required(VERSION 3.8...3.28) +include_guard(GLOBAL) # Fallback for using newer policies on CMake <3.12. if (${CMAKE_VERSION} VERSION_LESS 3.12) cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) endif () -# Determine if fmt is built as a subproject (using add_subdirectory) -# or if it is the master project. +# Determine if fmt is built as a subproject (using add_subdirectory) or if it is +# the master project. if (NOT DEFINED FMT_MASTER_PROJECT) set(FMT_MASTER_PROJECT OFF) - # NOTE: source vs current_source detection is unreliable - # this heuristic is more generally applicable esp w.r.t FetchContent + # Checking project name is more reliable than checking source directories. if (NOT DEFINED PROJECT_NAME) set(FMT_MASTER_PROJECT ON) message(STATUS "CMake version: ${CMAKE_VERSION}") @@ -18,174 +18,95 @@ if (NOT DEFINED FMT_MASTER_PROJECT) endif () # Joins arguments and places the results in ${result_var}. -function(join result_var) +function (join result_var) set(result "") foreach (arg ${ARGN}) set(result "${result}${arg}") endforeach () - set(${result_var} "${result}" PARENT_SCOPE) -endfunction() - -# DEPRECATED! Should be merged into add_module_library. -function(enable_module target) - if (MSVC) - if(NOT CMAKE_GENERATOR STREQUAL "Ninja") - set(BMI_DIR "${CMAKE_CURRENT_BINARY_DIR}") - file(TO_NATIVE_PATH "${BMI_DIR}/${target}.ifc" BMI) - target_compile_options(${target} - PRIVATE /interface /ifcOutput ${BMI} - INTERFACE /reference fmt=${BMI}) - set_target_properties(${target} PROPERTIES ADDITIONAL_CLEAN_FILES ${BMI}) - set_source_files_properties(${BMI} PROPERTIES GENERATED ON) - endif() - endif () -endfunction() - -set(FMT_USE_CMAKE_MODULES FALSE) -if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.28 AND - CMAKE_GENERATOR STREQUAL "Ninja") - set(FMT_USE_CMAKE_MODULES TRUE) -endif () - -# Adds a library compiled with C++20 module support. -# `enabled` is a CMake variables that specifies if modules are enabled. -# If modules are disabled `add_module_library` falls back to creating a -# non-modular library. -# -# Usage: -# add_module_library( [sources...] FALLBACK [sources...] [IF enabled]) -function(add_module_library name) - cmake_parse_arguments(AML "" "IF" "FALLBACK" ${ARGN}) - set(sources ${AML_UNPARSED_ARGUMENTS}) - - add_library(${name}) - set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX) - - if (NOT ${${AML_IF}}) - # Create a non-modular library. - target_sources(${name} PRIVATE ${AML_FALLBACK}) - set_target_properties(${name} PROPERTIES CXX_SCAN_FOR_MODULES OFF) - return() - endif () - - # Modules require C++20. - target_compile_features(${name} PUBLIC cxx_std_20) - if (CMAKE_COMPILER_IS_GNUCXX) - target_compile_options(${name} PUBLIC -fmodules-ts) - endif () - - if (FMT_USE_CMAKE_MODULES) - target_sources(${name} PUBLIC FILE_SET fmt TYPE CXX_MODULES - FILES ${sources}) - else() - # `std` is affected by CMake options and may be higher than C++20. - get_target_property(std ${name} CXX_STANDARD) - - if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(pcms) - foreach (src ${sources}) - get_filename_component(pcm ${src} NAME_WE) - set(pcm ${pcm}.pcm) - - # Propagate -fmodule-file=*.pcm to targets that link with this library. - target_compile_options( - ${name} PUBLIC -fmodule-file=${CMAKE_CURRENT_BINARY_DIR}/${pcm}) - - # Use an absolute path to prevent target_link_libraries prepending -l - # to it. - set(pcms ${pcms} ${CMAKE_CURRENT_BINARY_DIR}/${pcm}) - add_custom_command( - OUTPUT ${pcm} - COMMAND ${CMAKE_CXX_COMPILER} - -std=c++${std} -x c++-module --precompile -c - -o ${pcm} ${CMAKE_CURRENT_SOURCE_DIR}/${src} - "-I$,;-I>" - # Required by the -I generator expression above. - COMMAND_EXPAND_LISTS - DEPENDS ${src}) - endforeach () - - # Add .pcm files as sources to make sure they are built before the library. - set(sources) - foreach (pcm ${pcms}) - get_filename_component(pcm_we ${pcm} NAME_WE) - set(obj ${pcm_we}.o) - # Use an absolute path to prevent target_link_libraries prepending -l. - set(sources ${sources} ${pcm} ${CMAKE_CURRENT_BINARY_DIR}/${obj}) - add_custom_command( - OUTPUT ${obj} - COMMAND ${CMAKE_CXX_COMPILER} $ - -c -o ${obj} ${pcm} - DEPENDS ${pcm}) - endforeach () - endif () - target_sources(${name} PRIVATE ${sources}) - endif() -endfunction() - -include(CMakeParseArguments) + set(${result_var} + "${result}" + PARENT_SCOPE) +endfunction () # Sets a cache variable with a docstring joined from multiple arguments: -# set( ... CACHE ...) +# set_verbose( CACHE ...) # This allows splitting a long docstring for readability. -function(set_verbose) - # cmake_parse_arguments is broken in CMake 3.4 (cannot parse CACHE) so use - # list instead. - list(GET ARGN 0 var) - list(REMOVE_AT ARGN 0) - list(GET ARGN 0 val) - list(REMOVE_AT ARGN 0) - list(REMOVE_AT ARGN 0) - list(GET ARGN 0 type) - list(REMOVE_AT ARGN 0) +function (set_verbose variable value _cache type) join(doc ${ARGN}) - set(${var} ${val} CACHE ${type} ${doc}) -endfunction() + set(${variable} + ${value} + CACHE ${type} ${doc}) +endfunction () # Set the default CMAKE_BUILD_TYPE to Release. # This should be done before the project command since the latter can set # CMAKE_BUILD_TYPE itself (it does so for nmake). if (FMT_MASTER_PROJECT AND NOT CMAKE_BUILD_TYPE) - set_verbose(CMAKE_BUILD_TYPE Release CACHE STRING - "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or " - "CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") + set_verbose( + CMAKE_BUILD_TYPE Release CACHE STRING + "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or " + "CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") endif () project(FMT CXX) -include(GNUInstallDirs) -set_verbose(FMT_INC_DIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE STRING - "Installation directory for include files, a relative path that " - "will be joined with ${CMAKE_INSTALL_PREFIX} or an absolute path.") -option(FMT_PEDANTIC "Enable extra warnings and expensive tests." OFF) -option(FMT_WERROR "Halt the compilation with an error on compiler warnings." - OFF) +# Determine support for the C++ module scanning and CXX_MODULE File_Sets +# Requires C++20, CMake >= 3.28 and +# Generators(Ninja >= 1.11 OR Visual Studio >= 17.4). +# Compilers GCC>=14, Clang>=16 or MSVC >= 17.4 +# Source: https://cmake.org/cmake/help/latest/manual/cmake-cxxmodules.7.html +set(FMT_USE_CMAKE_MODULES FALSE) +if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.28 AND CMAKE_CXX_STANDARD + GREATER_EQUAL 20) + if (CMAKE_GENERATOR STREQUAL "Ninja") + execute_process(COMMAND "${CMAKE_MAKE_PROGRAM}" "--version" + OUTPUT_VARIABLE NINJA_VERSION) + if (NINJA_VERSION VERSION_GREATER_EQUAL 1.11) + if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION + GREATER_EQUAL 15) + OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" + AND CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 16) + OR (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND MSVC_VERSION + GREATER_EQUAL 1934)) + set(FMT_USE_CMAKE_MODULES TRUE) + endif () + endif () + elseif (CMAKE_GENERATOR MATCHES "^Visual Studio" AND MSVC_VERSION + GREATER_EQUAL 1934) + set(FMT_USE_CMAKE_MODULES TRUE) + endif () +endif () -# Options that control generation of various targets. option(FMT_DOC "Generate the doc target." ${FMT_MASTER_PROJECT}) option(FMT_INSTALL "Generate the install target." ${FMT_MASTER_PROJECT}) option(FMT_TEST "Generate the test target." ${FMT_MASTER_PROJECT}) option(FMT_FUZZ "Generate the fuzz target." OFF) option(FMT_CUDA_TEST "Generate the cuda-test target." OFF) option(FMT_OS "Include OS-specific APIs." ON) -option(FMT_MODULE "Build a module instead of a traditional library." OFF) +option(FMT_MODULE "Build a module library." ${FMT_USE_CMAKE_MODULES}) option(FMT_SYSTEM_HEADERS "Expose headers with marking them as system." OFF) option(FMT_UNICODE "Enable Unicode support." ON) +option(FMT_PEDANTIC "Enable extra warnings and expensive tests." OFF) +option(FMT_WERROR "Halt the compilation with an error on compiler warnings." + OFF) -if (FMT_TEST AND FMT_MODULE) - # The tests require {fmt} to be compiled as traditional library - message(STATUS "Testing is incompatible with build mode 'module'.") -endif () set(FMT_SYSTEM_HEADERS_ATTRIBUTE "") if (FMT_SYSTEM_HEADERS) set(FMT_SYSTEM_HEADERS_ATTRIBUTE SYSTEM) endif () -if (CMAKE_SYSTEM_NAME STREQUAL "MSDOS") - set(FMT_TEST OFF) - message(STATUS "MSDOS is incompatible with gtest") -endif () -# Get version from base.h +include(GNUInstallDirs) # CMAKE_INSTALL_INCLUDEDIR + +set_verbose( + FMT_INC_DIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE STRING + "Installation directory for include files, a relative path that " + "will be joined with ${CMAKE_INSTALL_PREFIX} or an absolute path.") + +set(FMT_DEBUG_POSTFIX + d + CACHE STRING "Debug library postfix.") + +# Get version from base.h. file(READ include/fmt/base.h base_h) if (NOT base_h MATCHES "FMT_VERSION ([0-9]+)([0-9][0-9])([0-9][0-9])") message(FATAL_ERROR "Cannot get FMT_VERSION from base.h.") @@ -195,7 +116,7 @@ math(EXPR CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_MATCH_1}) math(EXPR CPACK_PACKAGE_VERSION_MINOR ${CMAKE_MATCH_2}) math(EXPR CPACK_PACKAGE_VERSION_PATCH ${CMAKE_MATCH_3}) join(FMT_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}. - ${CPACK_PACKAGE_VERSION_PATCH}) + ${CPACK_PACKAGE_VERSION_PATCH}) message(STATUS "{fmt} version: ${FMT_VERSION}") message(STATUS "Build type: ${CMAKE_BUILD_TYPE}") @@ -211,56 +132,83 @@ include(JoinPaths) if (FMT_MASTER_PROJECT AND NOT DEFINED CMAKE_CXX_VISIBILITY_PRESET) set_verbose(CMAKE_CXX_VISIBILITY_PRESET hidden CACHE STRING - "Preset for the export of private symbols") - set_property(CACHE CMAKE_CXX_VISIBILITY_PRESET PROPERTY STRINGS - hidden default) + "Preset for the export of private symbols.") + set_property(CACHE CMAKE_CXX_VISIBILITY_PRESET PROPERTY STRINGS hidden + default) endif () if (FMT_MASTER_PROJECT AND NOT DEFINED CMAKE_VISIBILITY_INLINES_HIDDEN) - set_verbose(CMAKE_VISIBILITY_INLINES_HIDDEN ON CACHE BOOL - "Whether to add a compile flag to hide symbols of inline functions") + set_verbose( + CMAKE_VISIBILITY_INLINES_HIDDEN ON CACHE BOOL + "Whether to add a compile flag to hide symbols of inline " "functions.") endif () if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set(PEDANTIC_COMPILE_FLAGS -pedantic-errors -Wall -Wextra -pedantic - -Wold-style-cast -Wundef - -Wredundant-decls -Wwrite-strings -Wpointer-arith - -Wcast-qual -Wformat=2 -Wmissing-include-dirs + set(PEDANTIC_COMPILE_FLAGS + -pedantic-errors + -Wall + -Wextra + -pedantic + -Wold-style-cast + -Wundef + -Wredundant-decls + -Wwrite-strings + -Wpointer-arith + -Wcast-qual + -Wformat=2 + -Wmissing-include-dirs -Wcast-align - -Wctor-dtor-privacy -Wdisabled-optimization - -Winvalid-pch -Woverloaded-virtual - -Wconversion -Wundef - -Wno-ctor-dtor-privacy -Wno-format-nonliteral) + -Wctor-dtor-privacy + -Wdisabled-optimization + -Winvalid-pch + -Woverloaded-virtual + -Wconversion + -Wundef + -Wno-ctor-dtor-privacy + -Wno-format-nonliteral) if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6) - set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} - -Wno-dangling-else -Wno-unused-local-typedefs) + set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wno-dangling-else + -Wno-unused-local-typedefs) endif () if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) - set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wdouble-promotion - -Wtrampolines -Wzero-as-null-pointer-constant -Wuseless-cast - -Wvector-operation-performance -Wsized-deallocation -Wshadow) + set(PEDANTIC_COMPILE_FLAGS + ${PEDANTIC_COMPILE_FLAGS} + -Wdouble-promotion + -Wtrampolines + -Wzero-as-null-pointer-constant + -Wuseless-cast + -Wvector-operation-performance + -Wsized-deallocation + -Wshadow) endif () if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0) - set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wshift-overflow=2 - -Wduplicated-cond) - # Workaround for GCC regression - # [12/13/14/15 regression] New (since gcc 12) false positive null-dereference in vector.resize - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108860 - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0) - set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wnull-dereference) - endif () + set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wshift-overflow=2 + -Wduplicated-cond) + # Workaround for GCC 12-15 regression: + # a false positive null-dereference in vector.resize + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108860. + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0) + set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} -Wnull-dereference) + endif () endif () set(WERROR_FLAG -Werror) endif () if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(PEDANTIC_COMPILE_FLAGS -Wall -Wextra -pedantic -Wconversion -Wundef - -Wdeprecated -Wweak-vtables -Wshadow + set(PEDANTIC_COMPILE_FLAGS + -Wall + -Wextra + -pedantic + -Wconversion + -Wundef + -Wdeprecated + -Wweak-vtables + -Wshadow -Wno-gnu-zero-variadic-macro-arguments) check_cxx_compiler_flag(-Wzero-as-null-pointer-constant HAS_NULLPTR_WARNING) if (HAS_NULLPTR_WARNING) set(PEDANTIC_COMPILE_FLAGS ${PEDANTIC_COMPILE_FLAGS} - -Wzero-as-null-pointer-constant) + -Wzero-as-null-pointer-constant) endif () set(WERROR_FLAG -Werror) endif () @@ -283,35 +231,66 @@ if (FMT_MASTER_PROJECT AND CMAKE_GENERATOR MATCHES "Visual Studio") join(netfxpath "C:\\Program Files\\Reference Assemblies\\Microsoft\\Framework\\" ".NETFramework\\v4.0") - file(WRITE run-msbuild.bat " - ${MSBUILD_SETUP} + file(WRITE run-msbuild.bat "${MSBUILD_SETUP} ${CMAKE_MAKE_PROGRAM} -p:FrameworkPathOverride=\"${netfxpath}\" %*") endif () -function(add_headers VAR) - set(headers ${${VAR}}) - foreach (header ${ARGN}) - set(headers ${headers} include/fmt/${header}) - endforeach() - set(${VAR} ${headers} PARENT_SCOPE) -endfunction() +# Sets up a top-level fmt target. Targets that depend on other top-level targets +# should call this because they'll automatically get the required properties. +function (setup_target target kind) + add_library(fmt::${target} ALIAS ${target}) + + target_include_directories( + ${target} ${FMT_SYSTEM_HEADERS_ATTRIBUTE} BEFORE ${kind} + $ + $) + + if (NOT MSVC) + # Unicode is always supported on compilers other than MSVC. + elseif (FMT_UNICODE) + # Unicode support requires compiling with /utf-8. + target_compile_options( + ${target} ${kind} + $<$,$>:/utf-8>) + else () + target_compile_definitions(${target} ${kind} FMT_UNICODE=0) + endif () + + set_target_properties( + ${target} + PROPERTIES VERSION ${FMT_VERSION} + SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR} + DEBUG_POSTFIX "${FMT_DEBUG_POSTFIX}") +endfunction () -# Define the fmt library, its includes and the needed defines. set(FMT_HEADERS) -add_headers(FMT_HEADERS args.h base.h chrono.h color.h compile.h core.h format.h - format-inl.h os.h ostream.h printf.h ranges.h std.h - xchar.h) -set(FMT_SOURCES src/format.cc) - -add_module_library(fmt src/fmt.cc FALLBACK - ${FMT_SOURCES} ${FMT_HEADERS} README.md ChangeLog.md - IF FMT_MODULE) -add_library(fmt::fmt ALIAS fmt) -if (FMT_MODULE) - enable_module(fmt) -elseif (FMT_OS) +foreach ( + header + args.h + base.h + chrono.h + color.h + compile.h + core.h + format.h + format-inl.h + os.h + ostream.h + printf.h + ranges.h + std.h + xchar.h) + set(FMT_HEADERS ${FMT_HEADERS} include/fmt/${header}) +endforeach () + +# Add the main fmt library. +add_library(fmt src/format.cc ${FMT_HEADERS} README.md ChangeLog.md) +setup_target(fmt PUBLIC) +set_target_properties(fmt PROPERTIES PUBLIC_HEADER "${FMT_HEADERS}") + +if (FMT_OS) target_sources(fmt PRIVATE src/os.cc) -else() +else () target_compile_definitions(fmt PRIVATE FMT_OS=0) endif () @@ -328,25 +307,6 @@ else () message(WARNING "Feature cxx_std_11 is unknown for the CXX compiler") endif () -target_include_directories(fmt ${FMT_SYSTEM_HEADERS_ATTRIBUTE} BEFORE PUBLIC - $ - $) - -set(FMT_DEBUG_POSTFIX d CACHE STRING "Debug library postfix.") - -set_target_properties(fmt PROPERTIES - VERSION ${FMT_VERSION} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR} - PUBLIC_HEADER "${FMT_HEADERS}" - DEBUG_POSTFIX "${FMT_DEBUG_POSTFIX}" - - # Workaround for Visual Studio 2017: - # Ensure the .pdb is created with the same name and in the same directory - # as the .lib. Newer VS versions already do this by default, but there is no - # harm in setting it for those too. Ignored by other generators. - COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" - COMPILE_PDB_NAME "fmt" - COMPILE_PDB_NAME_DEBUG "fmt${FMT_DEBUG_POSTFIX}") - # Set FMT_LIB_NAME for pkg-config fmt.pc. We cannot use the OUTPUT_NAME target # property because it's not set by default. set(FMT_LIB_NAME fmt) @@ -355,53 +315,147 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug") endif () if (BUILD_SHARED_LIBS) - target_compile_definitions(fmt PRIVATE FMT_LIB_EXPORT INTERFACE FMT_SHARED) + target_compile_definitions( + fmt + PRIVATE FMT_LIB_EXPORT + INTERFACE FMT_SHARED) endif () if (FMT_SAFE_DURATION_CAST) target_compile_definitions(fmt PUBLIC FMT_SAFE_DURATION_CAST) endif () -add_library(fmt-header-only INTERFACE) -add_library(fmt::fmt-header-only ALIAS fmt-header-only) - -if (NOT MSVC) - # Unicode is always supported on compilers other than MSVC. -elseif (FMT_UNICODE) - # Unicode support requires compiling with /utf-8. - target_compile_options(fmt PUBLIC $<$,$>:/utf-8>) - target_compile_options(fmt-header-only INTERFACE $<$,$>:/utf-8>) -else () - target_compile_definitions(fmt PUBLIC FMT_UNICODE=0) +# Adds a library compiled with C++20 module support. +# +# Usage: +# add_module_library( [sources...] [USE_CMAKE_MODULES TRUE]) +function (add_module_library name) + cmake_parse_arguments(AML "" "USE_CMAKE_MODULES" "" ${ARGN}) + set(sources ${AML_UNPARSED_ARGUMENTS}) + + add_library(${name}) + set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX) + + # Modules require C++20. + target_compile_features(${name} PUBLIC cxx_std_20) + + if (MSVC) + if (NOT CMAKE_GENERATOR STREQUAL "Ninja") + set(BMI_DIR "${CMAKE_CURRENT_BINARY_DIR}") + file(TO_NATIVE_PATH "${BMI_DIR}/${name}.ifc" BMI) + target_compile_options( + ${name} + PRIVATE /interface /ifcOutput ${BMI} + INTERFACE /reference fmt=${BMI}) + set_target_properties(${name} PROPERTIES ADDITIONAL_CLEAN_FILES ${BMI}) + set_source_files_properties(${BMI} PROPERTIES GENERATED ON) + endif () + endif () + + if (${AML_USE_CMAKE_MODULES}) + target_sources(${name} PUBLIC FILE_SET fmt TYPE CXX_MODULES FILES + ${sources}) + return() + endif () + + if (CMAKE_COMPILER_IS_GNUCXX) + target_compile_options(${name} PUBLIC -fmodules-ts) + endif () + + # `std` is affected by CMake options and may be higher than C++20. + get_target_property(std ${name} CXX_STANDARD) + + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(pcms) + foreach (src ${sources}) + get_filename_component(pcm ${src} NAME_WE) + set(pcm ${pcm}.pcm) + + # Propagate -fmodule-file=*.pcm to targets that link with this library. + target_compile_options( + ${name} PUBLIC -fmodule-file=${CMAKE_CURRENT_BINARY_DIR}/${pcm}) + + # Use an absolute path to prevent target_link_libraries prepending -l + # to it. + set(pcms ${pcms} ${CMAKE_CURRENT_BINARY_DIR}/${pcm}) + add_custom_command( + OUTPUT ${pcm} + COMMAND + ${CMAKE_CXX_COMPILER} -std=c++${std} -x c++-module --precompile -c -o + ${pcm} ${CMAKE_CURRENT_SOURCE_DIR}/${src} + "-I$,;-I>" + # Required by the -I generator expression above. + COMMAND_EXPAND_LISTS + DEPENDS ${src}) + endforeach () + + # Add .pcm files as sources to make sure they are built before the library. + set(sources) + foreach (pcm ${pcms}) + get_filename_component(pcm_we ${pcm} NAME_WE) + set(obj ${pcm_we}.o) + # Use an absolute path to prevent target_link_libraries prepending -l. + set(sources ${sources} ${pcm} ${CMAKE_CURRENT_BINARY_DIR}/${obj}) + add_custom_command( + OUTPUT ${obj} + COMMAND ${CMAKE_CXX_COMPILER} $ + -c -o ${obj} ${pcm} + DEPENDS ${pcm}) + endforeach () + endif () + target_sources(${name} PRIVATE ${sources}) +endfunction () + +if (FMT_MODULE) + add_module_library(fmt-module src/fmt.cc USE_CMAKE_MODULES + ${FMT_USE_CMAKE_MODULES}) + setup_target(fmt-module PUBLIC) endif () +add_library(fmt-header-only INTERFACE) + target_compile_definitions(fmt-header-only INTERFACE FMT_HEADER_ONLY=1) target_compile_features(fmt-header-only INTERFACE cxx_std_11) +setup_target(fmt-header-only INTERFACE) + +add_library(fmt-c STATIC src/fmt-c.cc) +target_compile_features(fmt-c INTERFACE c_std_11) +if (MSVC) + target_compile_options(fmt-c PUBLIC /Zc:preprocessor) +endif () +target_link_libraries(fmt-c PUBLIC fmt::fmt) +add_library(fmt::fmt-c ALIAS fmt-c) -target_include_directories(fmt-header-only - ${FMT_SYSTEM_HEADERS_ATTRIBUTE} BEFORE INTERFACE - $ - $) +set_target_properties(fmt-c PROPERTIES PUBLIC_HEADER include/fmt/fmt-c.h) # Install targets. if (FMT_INSTALL) include(CMakePackageConfigHelpers) - set_verbose(FMT_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/fmt CACHE STRING - "Installation directory for cmake files, a relative path that " - "will be joined with ${CMAKE_INSTALL_PREFIX} or an absolute " - "path.") + set_verbose( + FMT_CMAKE_DIR + ${CMAKE_INSTALL_LIBDIR}/cmake/fmt + CACHE + STRING + "Installation directory for cmake files, a relative path that " + "will be joined with ${CMAKE_INSTALL_PREFIX} or an absolute " + "path.") set(version_config ${PROJECT_BINARY_DIR}/fmt-config-version.cmake) set(project_config ${PROJECT_BINARY_DIR}/fmt-config.cmake) set(pkgconfig ${PROJECT_BINARY_DIR}/fmt.pc) set(targets_export_name fmt-targets) - set_verbose(FMT_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING - "Installation directory for libraries, a relative path that " - "will be joined to ${CMAKE_INSTALL_PREFIX} or an absolute path.") + set_verbose( + FMT_LIB_DIR ${CMAKE_INSTALL_LIBDIR} CACHE STRING + "Installation directory for libraries, a relative path that " + "will be joined to ${CMAKE_INSTALL_PREFIX} or an absolute path.") - set_verbose(FMT_PKGCONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig CACHE STRING - "Installation directory for pkgconfig (.pc) files, a relative " - "path that will be joined with ${CMAKE_INSTALL_PREFIX} or an " - "absolute path.") + set_verbose( + FMT_PKGCONFIG_DIR + ${CMAKE_INSTALL_LIBDIR}/pkgconfig + CACHE + STRING + "Installation directory for pkgconfig (.pc) files, a relative " + "path that will be joined with ${CMAKE_INSTALL_PREFIX} or an " + "absolute path.") # Generate the version, config and target files into the build directory. write_basic_package_version_file( @@ -412,85 +466,90 @@ if (FMT_INSTALL) join_paths(libdir_for_pc_file "\${exec_prefix}" "${FMT_LIB_DIR}") join_paths(includedir_for_pc_file "\${prefix}" "${FMT_INC_DIR}") - configure_file( - "${PROJECT_SOURCE_DIR}/support/cmake/fmt.pc.in" - "${pkgconfig}" - @ONLY) + configure_file("${PROJECT_SOURCE_DIR}/support/cmake/fmt.pc.in" "${pkgconfig}" + @ONLY) configure_package_config_file( - ${PROJECT_SOURCE_DIR}/support/cmake/fmt-config.cmake.in - ${project_config} + ${PROJECT_SOURCE_DIR}/support/cmake/fmt-config.cmake.in ${project_config} INSTALL_DESTINATION ${FMT_CMAKE_DIR}) - set(INSTALL_TARGETS fmt fmt-header-only) + set(INSTALL_TARGETS fmt fmt-header-only fmt-c) - set(INSTALL_FILE_SET) - if (FMT_USE_CMAKE_MODULES) - set(INSTALL_FILE_SET FILE_SET fmt DESTINATION "${FMT_INC_DIR}/fmt") - endif() + if (FMT_MODULE) + list(APPEND INSTALL_TARGETS fmt-module) + if (FMT_USE_CMAKE_MODULES) + set(INSTALL_FILE_SET FILE_SET fmt DESTINATION ${FMT_INC_DIR}/fmt) + endif () + endif () # Install the library and headers. - install(TARGETS ${INSTALL_TARGETS} - COMPONENT fmt_core - EXPORT ${targets_export_name} - LIBRARY DESTINATION ${FMT_LIB_DIR} - ARCHIVE DESTINATION ${FMT_LIB_DIR} - PUBLIC_HEADER DESTINATION "${FMT_INC_DIR}/fmt" - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - ${INSTALL_FILE_SET}) + install( + TARGETS ${INSTALL_TARGETS} + COMPONENT fmt_core + EXPORT ${targets_export_name} + LIBRARY DESTINATION ${FMT_LIB_DIR} + ARCHIVE DESTINATION ${FMT_LIB_DIR} + PUBLIC_HEADER DESTINATION ${FMT_INC_DIR}/fmt + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ${INSTALL_FILE_SET}) # Use a namespace because CMake provides better diagnostics for namespaced # imported targets. - export(TARGETS ${INSTALL_TARGETS} NAMESPACE fmt:: - FILE ${PROJECT_BINARY_DIR}/${targets_export_name}.cmake) + export( + TARGETS ${INSTALL_TARGETS} + NAMESPACE fmt:: + FILE ${PROJECT_BINARY_DIR}/${targets_export_name}.cmake) # Install version, config and target files. - install(FILES ${project_config} ${version_config} - DESTINATION ${FMT_CMAKE_DIR} - COMPONENT fmt_core) - install(EXPORT ${targets_export_name} DESTINATION ${FMT_CMAKE_DIR} - NAMESPACE fmt:: - COMPONENT fmt_core) - - install(FILES "${pkgconfig}" DESTINATION "${FMT_PKGCONFIG_DIR}" - COMPONENT fmt_core) + install( + FILES ${project_config} ${version_config} + DESTINATION ${FMT_CMAKE_DIR} + COMPONENT fmt_core) + install( + EXPORT ${targets_export_name} + DESTINATION ${FMT_CMAKE_DIR} + NAMESPACE fmt:: + COMPONENT fmt_core) + + install( + FILES "${pkgconfig}" + DESTINATION "${FMT_PKGCONFIG_DIR}" + COMPONENT fmt_core) endif () -function(add_doc_target) - find_program(DOXYGEN doxygen - PATHS "$ENV{ProgramFiles}/doxygen/bin" - "$ENV{ProgramFiles\(x86\)}/doxygen/bin") +function (add_doc_target) + find_program(DOXYGEN doxygen PATHS "$ENV{ProgramFiles}/doxygen/bin" + "$ENV{ProgramFiles\(x86\)}/doxygen/bin") if (NOT DOXYGEN) message(STATUS "Target 'doc' disabled because doxygen not found") - return () + return() endif () find_program(MKDOCS mkdocs) if (NOT MKDOCS) message(STATUS "Target 'doc' disabled because mkdocs not found") - return () + return() endif () - set(sources ) + set(sources) foreach (source api.md index.md syntax.md get-started.md fmt.css fmt.js) set(sources ${sources} doc/${source}) - endforeach() + endforeach () add_custom_target( doc COMMAND - ${CMAKE_COMMAND} - -E env PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}/support/python - ${MKDOCS} build -f ${CMAKE_CURRENT_SOURCE_DIR}/support/mkdocs.yml - # MkDocs requires the site dir to be outside of the doc dir. - --site-dir ${CMAKE_CURRENT_BINARY_DIR}/doc-html - --no-directory-urls + ${CMAKE_COMMAND} -E env + PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}/support/python ${MKDOCS} build -f + ${CMAKE_CURRENT_SOURCE_DIR}/support/mkdocs.yml + # MkDocs requires the site dir to be outside of the doc dir. + --site-dir ${CMAKE_CURRENT_BINARY_DIR}/doc-html --no-directory-urls SOURCES ${sources}) - include(GNUInstallDirs) - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc-html/ - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/fmt - COMPONENT fmt_doc OPTIONAL) -endfunction() + install( + DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc-html/ + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/fmt + COMPONENT fmt_doc + OPTIONAL) +endfunction () if (FMT_DOC) add_doc_target() @@ -516,14 +575,16 @@ endif () set(gitignore ${PROJECT_SOURCE_DIR}/.gitignore) if (FMT_MASTER_PROJECT AND EXISTS ${gitignore}) # Get the list of ignored files from .gitignore. - file (STRINGS ${gitignore} lines) + file(STRINGS ${gitignore} lines) list(REMOVE_ITEM lines /doc/html) foreach (line ${lines}) string(REPLACE "." "[.]" line "${line}") string(REPLACE "*" ".*" line "${line}") set(ignored_files ${ignored_files} "${line}$" "${line}/") endforeach () - set(ignored_files ${ignored_files} /.git /build/doxyxml .vagrant) + # Exclude the whole build tree: the .gitignore-derived `build/` pattern does + # not actually prune the directory or its contents from the source package. + set(ignored_files ${ignored_files} /.git "/build($|/)" .vagrant) set(CPACK_SOURCE_GENERATOR ZIP) set(CPACK_SOURCE_IGNORE_FILES ${ignored_files}) diff --git a/dep/fmt/ChangeLog.md b/dep/fmt/ChangeLog.md index e96f9df8c..d132266d7 100644 --- a/dep/fmt/ChangeLog.md +++ b/dep/fmt/ChangeLog.md @@ -1,3 +1,226 @@ +# 12.2.0 - 2026-06-16 + +- Added a C11 API that brings fast, type-safe formatting to C. The new + `fmt-c` library and `fmt/fmt-c.h` header use `_Generic` to dispatch on + argument types and outperform `printf`/`sprintf`. For example: + + ```c++ + #include + + fmt_print(stdout, "The answer is {}.\n", 42); + ``` + + (https://github.com/fmtlib/fmt/issues/4663, + https://github.com/fmtlib/fmt/pull/4671, + https://github.com/fmtlib/fmt/pull/4696, + https://github.com/fmtlib/fmt/issues/4693, + https://github.com/fmtlib/fmt/pull/4694, + https://github.com/fmtlib/fmt/pull/4712, + https://github.com/fmtlib/fmt/pull/4789). + Thanks @Soumik15630m, @Ferdi265 and @localspook. + +- Added a separate `fmt::fmt-module` CMake target for C++20 modules and a + CI workflow that exercises module-based builds + (https://github.com/fmtlib/fmt/issues/4684, + https://github.com/fmtlib/fmt/pull/4685, + https://github.com/fmtlib/fmt/issues/4707, + https://github.com/fmtlib/fmt/pull/4708, + https://github.com/fmtlib/fmt/pull/4702, + https://github.com/fmtlib/fmt/pull/4709). + Thanks @MathewBensonCode. + +- Enabled the full Dragonbox lookup cache by default for floating-point + formatting unless optimizing for binary size (`__OPTIMIZE_SIZE__`), + giving a ~10–25% speedup. Thanks Matthias Kretz for the suggestion. + Average time per `double` on Apple M1 Pro (clang 17, random digits, + smaller is better) measured with + [dtoa-benchmark](https://github.com/fmtlib/dtoa-benchmark): + + | Method | Time (ns) | + | ----------------------- | --------: | + | fmt (full) | 22.07 | + | fmt (compact) | 29.55 | + | ryu | 35.21 | + | double-conversion | 81.81 | + | `sprintf` | 726.27 | + | `ostringstream` | 864.34 | + +- Improved integer formatting performance by ~3% + (https://github.com/fmtlib/fmt/pull/4630). Thanks @user202729. + +- Optimized formatting into back-insert iterators by using bulk container + append/insert methods (e.g. on `std::vector` and custom string + types) (https://github.com/fmtlib/fmt/pull/4679). Thanks @user202729. + +- Reduced binary size of debug builds (~200k to ~85k in the bloat test) and + improved compile speed when `consteval` is unavailable. + +- Made path formatting lossless, preserving ill-formed UTF-16 + sequences when converting `std::filesystem::path` to a narrow string. + +- Added support for formatting `std::unexpected` + (https://github.com/fmtlib/fmt/pull/4675). Thanks @17steen. + +- Added overloads of `fmt::println` that take a `fmt::text_style` + (https://github.com/fmtlib/fmt/pull/4782). Thanks @ahoarau. + +- Added support for positional arguments as width and precision specifiers + in `fmt::printf` (https://github.com/fmtlib/fmt/pull/4643). + Thanks @KareemOtoum. + +- Made `FMT_STRING` a no-op when `FMT_USE_CONSTEVAL` is enabled, since the + consteval format-string constructor already provides compile-time + validation + (https://github.com/fmtlib/fmt/issues/4611, + https://github.com/fmtlib/fmt/pull/4612). Thanks @friedkeenan. + +- Promoted `fmt::detail::named_arg` to the public API as `fmt::named_arg` and + deprecated the detail alias + (https://github.com/fmtlib/fmt/issues/4683, + https://github.com/fmtlib/fmt/pull/4687). Thanks @TPPPP72. + +- Moved the `std::byte` formatter from `fmt/format.h` to `fmt/std.h`. + +- Provided a default definition for `fmt::is_contiguous` + (https://github.com/fmtlib/fmt/pull/4731, + https://github.com/fmtlib/fmt/pull/4770). Thanks @user202729 and @phprus. + +- Added the `FMT_USE_FLOCKFILE` macro to disable the use of `flockfile` + (https://github.com/fmtlib/fmt/issues/4646, + https://github.com/fmtlib/fmt/pull/4666). Thanks @mvastola. + +- Added `include_guard(GLOBAL)` so that {fmt} can be used in multiple + submodules of the same project + (https://github.com/fmtlib/fmt/pull/4672). Thanks @torsten48. + +- Improved `constexpr` support + (https://github.com/fmtlib/fmt/pull/4659, + https://github.com/fmtlib/fmt/pull/4591). + Thanks @elbeno and @17steen. + +- Deprecated the implicit conversion from `fmt::format_string` and + `fmt::basic_fstring` to `string_view` to align with `std::format_string`; + use `format_string::get()` instead. + +- Opted out `std::complex` from tuple formatting so that the dedicated + `std::complex` formatter is always used. + +- Removed the `fmt::say` function. + +- Deprecated the `std::initializer_list` overload of `fmt::join` and the array + overload of `fmt::vformat_to`. + +- Made the `` header equivalent to `` by + default. Code that relied on `` pulling in `` + must now either include `` directly or define + `FMT_DEPRECATED_HEAVY_CORE` to opt back in. + +- Improved `wchar_t` support: `fmt::join` now accepts `wchar_t` and other + non-`char` separators, and `fmt::format_to_n` now works with `fmt::runtime` + on `wchar_t` + (https://github.com/fmtlib/fmt/pull/4686, + https://github.com/fmtlib/fmt/issues/4714, + https://github.com/fmtlib/fmt/pull/4715). + Thanks @Yancey2023 and @sunmy2019. + +- Fixed formatting of `std::tm` with a null `tm_zone` + (https://github.com/fmtlib/fmt/pull/4790). Thanks @Carmel0. + +- Fixed compile-time formatting in `fmt/ranges.h`, `fmt/style.h` and + `fmt/std.h` (https://github.com/fmtlib/fmt/pull/4759). Thanks @j4niwzis. + +- Fixed an ambiguity between `formatter>` in `fmt/std.h` + and `fmt/ranges.h` on C++26 (P3168R2) + (https://github.com/fmtlib/fmt/pull/4761). Thanks @phprus. + +- Fixed a GCC PCH breakage triggered by a scoped `#pragma GCC optimize`. + +- Fixed a TSAN false positive in the locale handling code + (https://github.com/fmtlib/fmt/issues/4755). + +- Fixed compile-time format string checks truncating string literals at + an embedded null byte + (https://github.com/fmtlib/fmt/pull/4732). Thanks @user202729. + +- Fixed out-of-bounds reads in `printf` formatting + (https://github.com/fmtlib/fmt/issues/4741, + https://github.com/fmtlib/fmt/pull/4742, + https://github.com/fmtlib/fmt/pull/4800). + Thanks @Algunenano and @aizu-m. + +- Fixed the return type of the `f(un)lockfile` wrappers on Windows + (https://github.com/fmtlib/fmt/pull/4739). Thanks @mvastola. + +- Worked around a CUDA issue when handling UTF-32 literals + (https://github.com/fmtlib/fmt/pull/4719). Thanks @Cazadorro. + +- Fixed missing named-argument validation for compiled format strings + (https://github.com/fmtlib/fmt/pull/4638). Thanks @JaeheonShim. + +- Fixed `fmt::format_to_n` in `` failing to compile when + `` is not transitively included + (https://github.com/fmtlib/fmt/issues/4615). + +- Fixed handling of pointers in format string compilation with + `FMT_BUILTIN_TYPES=0`. + +- Stopped assuming nul termination of the format string in `fmt::printf`. + Thanks @ZUENS2020 for reporting. + +- Fixed a build error when locale support is disabled + (https://github.com/fmtlib/fmt/pull/4627). Thanks @marcel-behlau-elfin. + +- Fixed a fallback range formatter for types with a `container_type` member + (https://github.com/fmtlib/fmt/issues/4123, + https://github.com/fmtlib/fmt/pull/4660). Thanks @Soumik15630m. + +- Fixed C++20 concept detection + (https://github.com/fmtlib/fmt/pull/4653). Thanks @tearfur. + +- Fixed a clang compilation failure + (https://github.com/fmtlib/fmt/pull/4718). Thanks @mccakit. + +- Fixed various MSVC warnings, including C4305 and conversion warnings on + x86 (https://github.com/fmtlib/fmt/pull/4668, + https://github.com/fmtlib/fmt/pull/4594). + Thanks @kanren3 and @blizzard4591. + +- Updated the Android Gradle Plugin to 9.x + (https://github.com/fmtlib/fmt/issues/4651, + https://github.com/fmtlib/fmt/pull/4658). Thanks @Soumik15630m. + +- Made various code, build and test improvements + (https://github.com/fmtlib/fmt/pull/4625, + https://github.com/fmtlib/fmt/pull/4639, + https://github.com/fmtlib/fmt/pull/4644, + https://github.com/fmtlib/fmt/pull/4656, + https://github.com/fmtlib/fmt/pull/4680, + https://github.com/fmtlib/fmt/pull/4681, + https://github.com/fmtlib/fmt/pull/4704, + https://github.com/fmtlib/fmt/pull/4710, + https://github.com/fmtlib/fmt/pull/4713, + https://github.com/fmtlib/fmt/pull/4729, + https://github.com/fmtlib/fmt/pull/4751, + https://github.com/fmtlib/fmt/pull/4758, + https://github.com/fmtlib/fmt/pull/4799). + Thanks @ZephyrLykos, @togunchan, @kagancansit, @BerndPetrovitsch, + @Skylion007, @st0rmbtw, @localspook and @EXtremeExploit. + +- Improved documentation, including a rewrite of the format string syntax, + better handling of doxygen tags, documenting `output_file`, fixing CSS so + that whitespace is displayed properly, and various smaller fixes + (https://github.com/fmtlib/fmt/pull/4622, + https://github.com/fmtlib/fmt/pull/4626, + https://github.com/fmtlib/fmt/pull/4631, + https://github.com/fmtlib/fmt/pull/4667, + https://github.com/fmtlib/fmt/pull/4616, + https://github.com/fmtlib/fmt/pull/4748). + Thanks @heavywatal, @ZephyrLykos, @user202729, @ssszcmawo, @bigmoonbit + and @Powerbyte7. + +- Added building of release artifacts and SLSA provenance in CI, added a + CodeQL workflow, and added the security policy in `.github/SECURITY.md`. + # 12.1.0 - 2025-10-29 - Optimized `buffer::append`, resulting in up to ~16% improvement on spdlog diff --git a/dep/fmt/LICENSE b/dep/fmt/LICENSE index 1cd1ef926..795fdaec8 100644 --- a/dep/fmt/LICENSE +++ b/dep/fmt/LICENSE @@ -18,10 +18,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---- Optional exception to the license --- - -As an exception, if, as a result of your compiling your source code, portions -of this Software are embedded into a machine-executable object form of such -source code, you may redistribute such embedded portions in such object form -without including the above copyright and permission notices. diff --git a/dep/fmt/README.md b/dep/fmt/README.md index 612c10c55..fabb2e836 100644 --- a/dep/fmt/README.md +++ b/dep/fmt/README.md @@ -1,19 +1,25 @@ {fmt} -[![image](https://github.com/fmtlib/fmt/workflows/linux/badge.svg)](https://github.com/fmtlib/fmt/actions?query=workflow%3Alinux) -[![image](https://github.com/fmtlib/fmt/workflows/macos/badge.svg)](https://github.com/fmtlib/fmt/actions?query=workflow%3Amacos) -[![image](https://github.com/fmtlib/fmt/workflows/windows/badge.svg)](https://github.com/fmtlib/fmt/actions?query=workflow%3Awindows) -[![fmt is continuously fuzzed at oss-fuzz](https://oss-fuzz-build-logs.storage.googleapis.com/badges/fmt.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?\%0Acolspec=ID%20Type%20Component%20Status%20Proj%20Reported%20Owner%20\%0ASummary&q=proj%3Dfmt&can=1) -[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8880/badge)](https://www.bestpractices.dev/projects/8880) -[![image](https://api.securityscorecards.dev/projects/github.com/fmtlib/fmt/badge)](https://securityscorecards.dev/viewer/?uri=github.com/fmtlib/fmt) -[![Ask questions at StackOverflow with the tag fmt](https://img.shields.io/badge/stackoverflow-fmt-blue.svg)](https://stackoverflow.com/questions/tagged/fmt) +[![image](https://github.com/fmtlib/fmt/actions/workflows/linux.yml/badge.svg?branch=master)]( +https://github.com/fmtlib/fmt/actions?query=workflow%3Alinux) +[![image](https://github.com/fmtlib/fmt/actions/workflows/macos.yml/badge.svg?branch=master)]( +https://github.com/fmtlib/fmt/actions?query=workflow%3Amacos) +[![image](https://github.com/fmtlib/fmt/actions/workflows/windows.yml/badge.svg?branch=master)]( +https://github.com/fmtlib/fmt/actions?query=workflow%3Awindows) +[![fmt is continuously fuzzed at oss-fuzz](https://oss-fuzz-build-logs.storage.googleapis.com/badges/fmt.svg)]( +https://issues.oss-fuzz.com/issues?q=title:fmt%20cc:victor.zverovich@gmail.com) +[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8880/badge)]( +https://www.bestpractices.dev/projects/8880) +[![image](https://api.securityscorecards.dev/projects/github.com/fmtlib/fmt/badge)]( +https://securityscorecards.dev/viewer/?uri=github.com/fmtlib/fmt) +[![Ask questions at StackOverflow with the tag fmt]( +https://img.shields.io/badge/stackoverflow-fmt-blue.svg)](https://stackoverflow.com/questions/tagged/fmt) +[![Support Ukraine]( +https://img.shields.io/badge/Support-Ukraine-005BBB?labelColor=FFD500)](https://novaukraine.org/) **{fmt}** is an open-source formatting library providing a fast and safe alternative to C stdio and C++ iostreams. -If you like this project, please consider donating to one of the funds -that help victims of the war in Ukraine: . - [Documentation](https://fmt.dev) [Cheat Sheets](https://hackingcpp.com/cpp/libs/fmt.html) @@ -38,7 +44,7 @@ Try {fmt} in [Compiler Explorer](https://godbolt.org/z/8Mx1EW73v). [Dragonbox](https://github.com/jk-jeon/dragonbox) algorithm - Portable Unicode support - Safe [printf - implementation](https://fmt.dev/latest/api/#printf-formatting) + implementation](https://fmt.dev/latest/api/#printf-api) including the POSIX extension for positional arguments - Extensibility: [support for user-defined types](https://fmt.dev/latest/api/#formatting-user-defined-types) @@ -150,8 +156,8 @@ int main() { } ``` -This can be [5 to 9 times faster than -fprintf](http://www.zverovich.net/2020/08/04/optimal-file-buffer-size.html). +This can be [up to 9 times faster than `fprintf`]( +http://www.zverovich.net/2020/08/04/optimal-file-buffer-size.html). **Print with colors and text styles** @@ -170,7 +176,7 @@ int main() { Output on a modern terminal with Unicode support: -![image](https://github.com/fmtlib/fmt/assets/%0A576385/2a93c904-d6fa-4aa6-b453-2618e1c327d7) +![image](https://github.com/fmtlib/fmt/assets/576385/2a93c904-d6fa-4aa6-b453-2618e1c327d7) # Benchmarks @@ -178,17 +184,17 @@ Output on a modern terminal with Unicode support: | Library | Method | Run Time, s | |-------------------|---------------|-------------| -| libc | printf | 0.91 | -| libc++ | std::ostream | 2.49 | -| {fmt} 9.1 | fmt::print | 0.74 | -| Boost Format 1.80 | boost::format | 6.26 | -| Folly Format | folly::format | 1.87 | +| libc | printf | 0.66 | +| libc++ | std::ostream | 1.63 | +| {fmt} 12.1 | fmt::print | 0.44 | +| Boost Format 1.88 | boost::format | 3.89 | +| Folly Format | folly::format | 1.28 | -{fmt} is the fastest of the benchmarked methods, \~20% faster than +{fmt} is the fastest of the benchmarked methods, \~50% faster than `printf`. The above results were generated by building `tinyformat_test.cpp` on -macOS 12.6.1 with `clang++ -O3 -DNDEBUG -DSPEED_TEST -DHAVE_FORMAT`, and +macOS 15.6.1 with `clang++ -O3 -DNDEBUG -DSPEED_TEST -DHAVE_FORMAT`, and taking the best of three runs. In the test, the format string `"%0.10f:%04d:%+g:%s:%p:%c:%%\n"` or equivalent is filled 2,000,000 times with output sent to `/dev/null`; for further details refer to the @@ -216,26 +222,26 @@ in the following tables. **Optimized build (-O3)** -| Method | Compile Time, s | Executable size, KiB | Stripped size, KiB | -|---------------|-----------------|----------------------|--------------------| -| printf | 1.6 | 54 | 50 | -| IOStreams | 25.9 | 98 | 84 | -| fmt 83652df | 4.8 | 54 | 50 | -| tinyformat | 29.1 | 161 | 136 | -| Boost Format | 55.0 | 530 | 317 | +| Method | Compile Time, s | Executable size, KiB | Stripped size, KiB | +|-----------------|-----------------|----------------------|--------------------| +| printf | 1.6 | 54 | 50 | +| IOStreams | 28.4 | 98 | 84 | +| {fmt} `1122268` | 5.0 | 54 | 50 | +| tinyformat | 32.6 | 164 | 136 | +| Boost Format | 55.0 | 530 | 317 | {fmt} is fast to compile and is comparable to `printf` in terms of per-call binary size (within a rounding error on this system). **Non-optimized build** -| Method | Compile Time, s | Executable size, KiB | Stripped size, KiB | -|---------------|-----------------|----------------------|--------------------| -| printf | 1.4 | 54 | 50 | -| IOStreams | 23.4 | 92 | 68 | -| {fmt} 83652df | 4.4 | 89 | 85 | -| tinyformat | 24.5 | 204 | 161 | -| Boost Format | 36.4 | 831 | 462 | +| Method | Compile Time, s | Executable size, KiB | Stripped size, KiB | +|-----------------|-----------------|----------------------|--------------------| +| printf | 1.4 | 54 | 50 | +| IOStreams | 27.0 | 88 | 68 | +| {fmt} `1122268` | 4.7 | 87 | 84 | +| tinyformat | 28.1 | 185 | 145 | +| Boost Format | 38.9 | 678 | 381 | `libc`, `lib(std)c++`, and `libfmt` are all linked as shared libraries to compare formatting function overhead only. Boost Format is a @@ -374,98 +380,6 @@ If you are aware of other projects using this library, please let me know by [email](mailto:victor.zverovich@gmail.com) or by submitting an [issue](https://github.com/fmtlib/fmt/issues). -# Motivation - -So why yet another formatting library? - -There are plenty of methods for doing this task, from standard ones like -the printf family of function and iostreams to Boost Format and -FastFormat libraries. The reason for creating a new library is that -every existing solution that I found either had serious issues or -didn\'t provide all the features I needed. - -## printf - -The good thing about `printf` is that it is pretty fast and readily -available being a part of the C standard library. The main drawback is -that it doesn\'t support user-defined types. `printf` also has safety -issues although they are somewhat mitigated with [\_\_attribute\_\_ -((format (printf, -\...))](https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html) in -GCC. There is a POSIX extension that adds positional arguments required -for -[i18n](https://en.wikipedia.org/wiki/Internationalization_and_localization) -to `printf` but it is not a part of C99 and may not be available on some -platforms. - -## iostreams - -The main issue with iostreams is best illustrated with an example: - -``` c++ -std::cout << std::setprecision(2) << std::fixed << 1.23456 << "\n"; -``` - -which is a lot of typing compared to printf: - -``` c++ -printf("%.2f\n", 1.23456); -``` - -Matthew Wilson, the author of FastFormat, called this \"chevron hell\". -iostreams don\'t support positional arguments by design. - -The good part is that iostreams support user-defined types and are safe -although error handling is awkward. - -## Boost Format - -This is a very powerful library that supports both `printf`-like format -strings and positional arguments. Its main drawback is performance. -According to various benchmarks, it is much slower than other methods -considered here. Boost Format also has excessive build times and severe -code bloat issues (see [Benchmarks](#benchmarks)). - -## FastFormat - -This is an interesting library that is fast, safe and has positional -arguments. However, it has significant limitations, citing its author: - -> Three features that have no hope of being accommodated within the -> current design are: -> -> - Leading zeros (or any other non-space padding) -> - Octal/hexadecimal encoding -> - Runtime width/alignment specification - -It is also quite big and has a heavy dependency, on STLSoft, which might be -too restrictive for use in some projects. - -## Boost Spirit.Karma - -This is not a formatting library but I decided to include it here for -completeness. As iostreams, it suffers from the problem of mixing -verbatim text with arguments. The library is pretty fast, but slower on -integer formatting than `fmt::format_to` with format string compilation -on Karma\'s own benchmark, see [Converting a hundred million integers to -strings per -second](http://www.zverovich.net/2020/06/13/fast-int-to-string-revisited.html). - -# License - -{fmt} is distributed under the MIT -[license](https://github.com/fmtlib/fmt/blob/master/LICENSE). - -# Documentation License - -The [Format String Syntax](https://fmt.dev/latest/syntax/) section -in the documentation is based on the one from Python [string module -documentation](https://docs.python.org/3/library/string.html#module-string). -For this reason, the documentation is distributed under the Python -Software Foundation license available in -[doc/python-license.txt](https://raw.github.com/fmtlib/fmt/master/doc/python-license.txt). -It only applies if you distribute the documentation of {fmt}. - # Maintainers The {fmt} library is maintained by Victor Zverovich @@ -475,12 +389,3 @@ people. See [Releases](https://github.com/fmtlib/fmt/releases) for some of the names. Let us know if your contribution is not listed or mentioned incorrectly and we\'ll make it right. - -# Security Policy - -To report a security issue, please disclose it at [security -advisory](https://github.com/fmtlib/fmt/security/advisories/new). - -This project is maintained by a team of volunteers on a -reasonable-effort basis. As such, please give us at least *90* days to -work on a fix before public exposure. diff --git a/dep/fmt/include/fmt/args.h b/dep/fmt/include/fmt/args.h index 5e5f40f9e..3283e6fa4 100644 --- a/dep/fmt/include/fmt/args.h +++ b/dep/fmt/include/fmt/args.h @@ -1,6 +1,6 @@ // Formatting library for C++ - dynamic argument lists // -// Copyright (c) 2012 - present, Victor Zverovich +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -113,8 +113,7 @@ FMT_EXPORT template class dynamic_format_arg_store { data_.emplace_back(arg); } - template - void emplace_arg(const detail::named_arg& arg) { + template void emplace_arg(const named_arg& arg) { if (named_info_.empty()) data_.insert(data_.begin(), basic_format_arg(nullptr, 0)); data_.emplace_back(detail::unwrap(arg.value)); @@ -152,7 +151,7 @@ FMT_EXPORT template class dynamic_format_arg_store { * std::string result = fmt::vformat("{} and {} and {}", store); */ template void push_back(const T& arg) { - if (detail::const_check(need_copy::value)) + if FMT_CONSTEXPR20 (need_copy::value) emplace_arg(dynamic_args_.push>(arg)); else emplace_arg(detail::unwrap(arg)); @@ -183,11 +182,10 @@ FMT_EXPORT template class dynamic_format_arg_store { * formatting function. `std::reference_wrapper` is supported to avoid * copying of the argument. The name is always copied into the store. */ - template - void push_back(const detail::named_arg& arg) { + template void push_back(const named_arg& arg) { const char_type* arg_name = dynamic_args_.push>(arg.name).c_str(); - if (detail::const_check(need_copy::value)) { + if FMT_CONSTEXPR20 (need_copy::value) { emplace_arg( fmt::arg(arg_name, dynamic_args_.push>(arg.value))); } else { diff --git a/dep/fmt/include/fmt/base.h b/dep/fmt/include/fmt/base.h index 0d5786778..5d0241c8c 100644 --- a/dep/fmt/include/fmt/base.h +++ b/dep/fmt/include/fmt/base.h @@ -1,6 +1,6 @@ // Formatting library for C++ - the base API for char/UTF-8 // -// Copyright (c) 2012 - present, Victor Zverovich +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -21,7 +21,7 @@ #endif // The fmt library version in the form major * 10000 + minor * 100 + patch. -#define FMT_VERSION 120100 +#define FMT_VERSION 120200 // Detect compiler versions. #if defined(__clang__) && !defined(__ibmxl__) @@ -126,8 +126,8 @@ # define FMT_USE_CONSTEVAL 0 #elif defined(__apple_build_version__) && __apple_build_version__ < 14000029L # define FMT_USE_CONSTEVAL 0 // consteval is broken in Apple clang < 14. -#elif FMT_MSC_VERSION && FMT_MSC_VERSION < 1929 -# define FMT_USE_CONSTEVAL 0 // consteval is broken in MSVC VS2019 < 16.10. +#elif FMT_MSC_VERSION && FMT_MSC_VERSION < 1940 +# define FMT_USE_CONSTEVAL 0 // consteval is broken in some MSVC2022 versions. #elif defined(__cpp_consteval) # define FMT_USE_CONSTEVAL 1 #elif FMT_GCC_VERSION >= 1002 || FMT_CLANG_VERSION >= 1101 @@ -223,20 +223,25 @@ #else # define FMT_PRAGMA_CLANG(x) #endif -#if FMT_MSC_VERSION -# define FMT_MSC_WARNING(...) __pragma(warning(__VA_ARGS__)) -#else -# define FMT_MSC_WARNING(...) + +#ifndef FMT_USE_OPTIMIZE_PRAGMA +# define FMT_USE_OPTIMIZE_PRAGMA 1 #endif // Enable minimal optimizations for more compact code in debug mode. FMT_PRAGMA_GCC(push_options) -#if !defined(__OPTIMIZE__) && !defined(__CUDACC__) && !defined(FMT_MODULE) +#if FMT_USE_OPTIMIZE_PRAGMA && !defined(__OPTIMIZE__) && \ + !defined(__CUDACC__) && !defined(FMT_MODULE) FMT_PRAGMA_GCC(optimize("Og")) -# define FMT_GCC_OPTIMIZED #endif -FMT_PRAGMA_CLANG(diagnostic push) -FMT_PRAGMA_GCC(diagnostic push) + +#ifdef FMT_DEPRECATED +// Use the provided definition. +#elif FMT_HAS_CPP14_ATTRIBUTE(deprecated) +# define FMT_DEPRECATED [[deprecated]] +#else +# define FMT_DEPRECATED /* deprecated */ +#endif #ifdef FMT_ALWAYS_INLINE // Use the provided definition. @@ -246,7 +251,7 @@ FMT_PRAGMA_GCC(diagnostic push) # define FMT_ALWAYS_INLINE inline #endif // A version of FMT_ALWAYS_INLINE to prevent code bloat in debug mode. -#if defined(NDEBUG) || defined(FMT_GCC_OPTIMIZED) +#ifdef NDEBUG # define FMT_INLINE FMT_ALWAYS_INLINE #else # define FMT_INLINE inline @@ -321,6 +326,8 @@ using underlying_t = typename std::underlying_type::type; template using decay_t = typename std::decay::type; using nullptr_t = decltype(nullptr); +using ullong = unsigned long long; + #if (FMT_GCC_VERSION && FMT_GCC_VERSION < 500) || FMT_MSC_VERSION // A workaround for gcc 4.9 & MSVC v141 to make void_t work in a SFINAE context. template struct void_t_impl { @@ -376,15 +383,7 @@ constexpr auto is_constant_evaluated(bool default_value = false) noexcept #endif } -// Suppresses "conditional expression is constant" warnings. -template FMT_ALWAYS_INLINE constexpr auto const_check(T val) -> T { - return val; -} - -FMT_NORETURN FMT_API void assert_fail(const char* file, int line, - const char* message); - -#if defined(FMT_ASSERT) +#ifdef FMT_ASSERT // Use the provided definition. #elif defined(NDEBUG) // FMT_ASSERT is not empty to avoid -Wempty-body. @@ -402,38 +401,21 @@ FMT_NORETURN FMT_API void assert_fail(const char* file, int line, #elif defined(__SIZEOF_INT128__) && !defined(__NVCC__) && \ !(FMT_CLANG_VERSION && FMT_MSC_VERSION) # define FMT_USE_INT128 1 -using int128_opt = __int128_t; // An optional native 128-bit integer. -using uint128_opt = __uint128_t; -inline auto map(int128_opt x) -> int128_opt { return x; } -inline auto map(uint128_opt x) -> uint128_opt { return x; } +using native_int128 = __int128_t; +using native_uint128 = __uint128_t; +inline auto map(native_int128 x) -> native_int128 { return x; } +inline auto map(native_uint128 x) -> native_uint128 { return x; } #else # define FMT_USE_INT128 0 #endif #if !FMT_USE_INT128 -enum class int128_opt {}; -enum class uint128_opt {}; -// Reduce template instantiations. -inline auto map(int128_opt) -> monostate { return {}; } -inline auto map(uint128_opt) -> monostate { return {}; } -#endif - -#ifdef FMT_USE_BITINT -// Use the provided definition. -#elif FMT_CLANG_VERSION >= 1500 && !defined(__CUDACC__) -# define FMT_USE_BITINT 1 -#else -# define FMT_USE_BITINT 0 +// Fallbacks to reduce conditional compilation and SFINAE. +enum class native_int128 {}; +enum class native_uint128 {}; +inline auto map(native_int128) -> monostate { return {}; } +inline auto map(native_uint128) -> monostate { return {}; } #endif -#if FMT_USE_BITINT -FMT_PRAGMA_CLANG(diagnostic ignored "-Wbit-int-extension") -template using bitint = _BitInt(N); -template using ubitint = unsigned _BitInt(N); -#else -template struct bitint {}; -template struct ubitint {}; -#endif // FMT_USE_BITINT - // Casts a nonnegative integer to unsigned. template FMT_CONSTEXPR auto to_unsigned(Int value) -> make_unsigned_t { @@ -499,22 +481,30 @@ struct is_back_insert_iterator< // Extracts a reference to the container from *insert_iterator. template -inline FMT_CONSTEXPR20 auto get_container(OutputIt it) -> +inline FMT_CONSTEXPR auto get_container(OutputIt it) -> typename OutputIt::container_type& { struct accessor : OutputIt { - FMT_CONSTEXPR20 accessor(OutputIt base) : OutputIt(base) {} + constexpr accessor(OutputIt base) : OutputIt(base) {} using OutputIt::container; }; return *accessor(it).container; } + +template +struct is_contiguous : std::false_type {}; +template +struct is_contiguous().data()), + decltype(std::declval().size()), + decltype(std::declval()[size_t()])>> + : std::true_type {}; } // namespace detail // Parsing-related public API and forward declarations. FMT_BEGIN_EXPORT /** - * An implementation of `std::basic_string_view` for pre-C++17. It provides a - * subset of the API. `fmt::basic_string_view` is used for format strings even + * An implementation of `std::basic_string_view` for pre-C++17 providing a + * subset of the API. `fmt::basic_string_view` is used in the public API even * if `std::basic_string_view` is available to prevent issues when a library is * compiled with a different `-std` option than the client code (which is not * recommended). @@ -529,18 +519,13 @@ template class basic_string_view { using iterator = const Char*; constexpr basic_string_view() noexcept : data_(nullptr), size_(0) {} - - /// Constructs a string view object from a C string and a size. constexpr basic_string_view(const Char* s, size_t count) noexcept : data_(s), size_(count) {} - constexpr basic_string_view(nullptr_t) = delete; - - /// Constructs a string view object from a C string. #if FMT_GCC_VERSION FMT_ALWAYS_INLINE #endif - FMT_CONSTEXPR20 basic_string_view(const Char* s) : data_(s) { + FMT_CONSTEXPR basic_string_view(const Char* s) : data_(s) { #if FMT_HAS_BUILTIN(__builtin_strlen) || FMT_GCC_VERSION || FMT_CLANG_VERSION if (std::is_same::value && !detail::is_constant_evaluated()) { size_ = __builtin_strlen(detail::narrow(s)); // strlen is not constexpr. @@ -552,18 +537,14 @@ template class basic_string_view { size_ = len; } - /// Constructs a string view from a `std::basic_string` or a - /// `std::basic_string_view` object. - template ::value&& std::is_same< - typename S::value_type, Char>::value)> - FMT_CONSTEXPR basic_string_view(const S& s) noexcept + template < + typename S, + FMT_ENABLE_IF(detail::is_std_string_like::value&& // + std::is_same::value)> + constexpr basic_string_view(const S& s) noexcept : data_(s.data()), size_(s.size()) {} - /// Returns a pointer to the string data. constexpr auto data() const noexcept -> const Char* { return data_; } - - /// Returns the string size. constexpr auto size() const noexcept -> size_t { return size_; } constexpr auto begin() const noexcept -> iterator { return data_; } @@ -578,21 +559,19 @@ template class basic_string_view { size_ -= n; } - FMT_CONSTEXPR auto starts_with(basic_string_view sv) const noexcept - -> bool { + FMT_CONSTEXPR auto starts_with(basic_string_view sv) const noexcept -> bool { return size_ >= sv.size_ && detail::compare(data_, sv.data_, sv.size_) == 0; } FMT_CONSTEXPR auto starts_with(Char c) const noexcept -> bool { return size_ >= 1 && *data_ == c; } FMT_CONSTEXPR auto starts_with(const Char* s) const -> bool { - return starts_with(basic_string_view(s)); + return starts_with(basic_string_view(s)); } FMT_CONSTEXPR auto compare(basic_string_view other) const -> int { - int result = - detail::compare(data_, other.data_, min_of(size_, other.size_)); - if (result != 0) return result; + int cmp = detail::compare(data_, other.data_, min_of(size_, other.size_)); + if (cmp != 0) return cmp; return size_ == other.size_ ? 0 : (size_ < other.size_ ? -1 : 1); } @@ -616,15 +595,11 @@ template class basic_string_view { return lhs.compare(rhs) >= 0; } }; - using string_view = basic_string_view; template class basic_appender; using appender = basic_appender; -// Checks whether T is a container with contiguous storage. -template struct is_contiguous : std::false_type {}; - class context; template class generic_context; template class parse_context; @@ -643,6 +618,8 @@ using buffered_context = conditional_t::value, context, generic_context, Char>>; +template struct is_contiguous : detail::is_contiguous {}; + template class basic_format_arg; template class basic_format_args; @@ -657,6 +634,9 @@ struct formatter { formatter() = delete; }; +template +struct locking : std::false_type {}; + /// Reports a format error at compile time or, via a `format_error` exception, /// at runtime. // This function is intentionally not constexpr to give a compile-time error. @@ -736,8 +716,7 @@ class basic_specs { char fill_data_[max_fill_size] = {' '}; FMT_CONSTEXPR void set_fill_size(size_t size) { - data_ = (data_ & ~fill_size_mask) | - (static_cast(size) << fill_size_shift); + data_ = (data_ & ~fill_size_mask) | (unsigned(size) << fill_size_shift); } public: @@ -745,21 +724,21 @@ class basic_specs { return static_cast(data_ & type_mask); } FMT_CONSTEXPR void set_type(presentation_type t) { - data_ = (data_ & ~type_mask) | static_cast(t); + data_ = (data_ & ~type_mask) | unsigned(t); } constexpr auto align() const -> align { return static_cast((data_ & align_mask) >> align_shift); } FMT_CONSTEXPR void set_align(fmt::align a) { - data_ = (data_ & ~align_mask) | (static_cast(a) << align_shift); + data_ = (data_ & ~align_mask) | (unsigned(a) << align_shift); } constexpr auto dynamic_width() const -> arg_id_kind { return static_cast((data_ & width_mask) >> width_shift); } FMT_CONSTEXPR void set_dynamic_width(arg_id_kind w) { - data_ = (data_ & ~width_mask) | (static_cast(w) << width_shift); + data_ = (data_ & ~width_mask) | (unsigned(w) << width_shift); } FMT_CONSTEXPR auto dynamic_precision() const -> arg_id_kind { @@ -767,8 +746,7 @@ class basic_specs { precision_shift); } FMT_CONSTEXPR void set_dynamic_precision(arg_id_kind p) { - data_ = (data_ & ~precision_mask) | - (static_cast(p) << precision_shift); + data_ = (data_ & ~precision_mask) | (unsigned(p) << precision_shift); } constexpr auto dynamic() const -> bool { @@ -779,7 +757,7 @@ class basic_specs { return static_cast((data_ & sign_mask) >> sign_shift); } FMT_CONSTEXPR void set_sign(fmt::sign s) { - data_ = (data_ & ~sign_mask) | (static_cast(s) << sign_shift); + data_ = (data_ & ~sign_mask) | (unsigned(s) << sign_shift); } constexpr auto upper() const -> bool { return (data_ & uppercase_mask) != 0; } @@ -809,9 +787,8 @@ class basic_specs { template constexpr auto fill_unit() const -> Char { using uchar = unsigned char; - return static_cast(static_cast(fill_data_[0]) | - (static_cast(fill_data_[1]) << 8) | - (static_cast(fill_data_[2]) << 16)); + return Char(uchar(fill_data_[0]) | uchar(fill_data_[1]) << 8 | + uchar(fill_data_[2]) << 16); } FMT_CONSTEXPR void set_fill(char c) { @@ -825,14 +802,13 @@ class basic_specs { set_fill_size(size); if (size == 1) { unsigned uchar = static_cast>(s[0]); - fill_data_[0] = static_cast(uchar); - fill_data_[1] = static_cast(uchar >> 8); - fill_data_[2] = static_cast(uchar >> 16); + fill_data_[0] = char(uchar); + fill_data_[1] = char(uchar >> 8); + fill_data_[2] = char(uchar >> 16); return; } FMT_ASSERT(size <= max_fill_size, "invalid fill"); - for (size_t i = 0; i < size; ++i) - fill_data_[i & 3] = static_cast(s[i]); + for (size_t i = 0; i < size; ++i) fill_data_[i & 3] = char(s[i]); } FMT_CONSTEXPR void copy_fill_from(const basic_specs& specs) { @@ -927,10 +903,13 @@ class locale_ref { template locale_ref(const Locale& loc) : locale_(&loc) { // Check if std::isalpha is found via ADL to reduce the chance of misuse. - isalpha('x', loc); + detail::ignore_unused(sizeof(isalpha('x', loc))); } inline explicit operator bool() const noexcept { return locale_ != nullptr; } +#else + public: + inline explicit operator bool() const noexcept { return false; } #endif // FMT_USE_LOCALE public: @@ -1017,9 +996,9 @@ struct type_constant : std::integral_constant {}; FMT_TYPE_CONSTANT(int, int_type); FMT_TYPE_CONSTANT(unsigned, uint_type); FMT_TYPE_CONSTANT(long long, long_long_type); -FMT_TYPE_CONSTANT(unsigned long long, ulong_long_type); -FMT_TYPE_CONSTANT(int128_opt, int128_type); -FMT_TYPE_CONSTANT(uint128_opt, uint128_type); +FMT_TYPE_CONSTANT(ullong, ulong_long_type); +FMT_TYPE_CONSTANT(native_int128, int128_type); +FMT_TYPE_CONSTANT(native_uint128, uint128_type); FMT_TYPE_CONSTANT(bool, bool_type); FMT_TYPE_CONSTANT(Char, char_type); FMT_TYPE_CONSTANT(float, float_type); @@ -1036,9 +1015,9 @@ constexpr auto is_arithmetic_type(type t) -> bool { return t > type::none_type && t <= type::last_numeric_type; } -constexpr auto set(type rhs) -> int { return 1 << static_cast(rhs); } +constexpr auto set(type rhs) -> int { return 1 << int(rhs); } constexpr auto in(type t, int set) -> bool { - return ((set >> static_cast(t)) & 1) != 0; + return ((set >> int(t)) & 1) != 0; } // Bitsets of types. @@ -1063,14 +1042,15 @@ struct is_view : std::false_type {}; template struct is_view> : std::is_base_of {}; -template struct named_arg; +// DEPRECATED! named_arg will be moved to the fmt namespace. +template struct named_arg; template struct is_named_arg : std::false_type {}; template struct is_static_named_arg : std::false_type {}; -template -struct is_named_arg> : std::true_type {}; +template +struct is_named_arg> : std::true_type {}; -template struct named_arg : view { +template struct named_arg : view { const Char* name; const T& value; @@ -1134,7 +1114,7 @@ FMT_CONSTEXPR void init_static_named_arg(named_arg_info* named_args, // either to int or to long long depending on its size. enum { long_short = sizeof(long) == sizeof(int) && FMT_BUILTIN_TYPES }; using long_type = conditional_t; -using ulong_type = conditional_t; +using ulong_type = conditional_t; template using format_as_result = @@ -1188,17 +1168,11 @@ template struct type_mapper { static auto map(long) -> long_type; static auto map(unsigned long) -> ulong_type; static auto map(long long) -> long long; - static auto map(unsigned long long) -> unsigned long long; - static auto map(int128_opt) -> int128_opt; - static auto map(uint128_opt) -> uint128_opt; + static auto map(ullong) -> ullong; + static auto map(native_int128) -> native_int128; + static auto map(native_uint128) -> native_uint128; static auto map(bool) -> bool; - template - static auto map(bitint) -> conditional_t; - template - static auto map(ubitint) - -> conditional_t; - template ::value)> static auto map(T) -> conditional_t< std::is_same::value || std::is_same::value, Char, void>; @@ -1258,9 +1232,9 @@ class compile_parse_context : public parse_context { using base = parse_context; public: - FMT_CONSTEXPR explicit compile_parse_context(basic_string_view fmt, - int num_args, const type* types, - int next_arg_id = 0) + constexpr explicit compile_parse_context(basic_string_view fmt, + int num_args, const type* types, + int next_arg_id = 0) : base(fmt, next_arg_id), num_args_(num_args), types_(types) {} constexpr auto num_args() const -> int { return num_args_; } @@ -1279,7 +1253,6 @@ class compile_parse_context : public parse_context { using base::check_arg_id; FMT_CONSTEXPR void check_dynamic_spec(int arg_id) { - ignore_unused(arg_id); if (arg_id < num_args_ && types_ && !is_integral_type(types_[arg_id])) report_error("width/precision is not integer"); } @@ -1305,13 +1278,13 @@ template struct dynamic_format_specs : format_specs { // Converts a character to ASCII. Returns '\0' on conversion failure. template ::value)> constexpr auto to_ascii(Char c) -> char { - return c <= 0xff ? static_cast(c) : '\0'; + return c <= 0xff ? char(c) : '\0'; } // Returns the number of code units in a code point or 1 on error. template FMT_CONSTEXPR auto code_point_length(const Char* begin) -> int { - if (const_check(sizeof(Char) != 1)) return 1; + if FMT_CONSTEXPR20 (sizeof(Char) != 1) return 1; auto c = static_cast(*begin); return static_cast((0x3a55000000000000ull >> (2 * (c >> 3))) & 3) + 1; } @@ -1331,13 +1304,13 @@ FMT_CONSTEXPR auto parse_nonnegative_int(const Char*& begin, const Char* end, } while (p != end && '0' <= *p && *p <= '9'); auto num_digits = p - begin; begin = p; - int digits10 = static_cast(sizeof(int) * CHAR_BIT * 3 / 10); - if (num_digits <= digits10) return static_cast(value); + int digits10 = int(sizeof(int) * CHAR_BIT * 3 / 10); + if (num_digits <= digits10) return int(value); // Check for overflow. unsigned max = INT_MAX; return num_digits == digits10 + 1 && prev * 10ull + unsigned(p[-1] - '0') <= max - ? static_cast(value) + ? int(value) : error_value; } @@ -1781,9 +1754,10 @@ template class buffer { protected: // Don't initialize ptr_ since it is not accessed to save a few cycles. - FMT_MSC_WARNING(suppress : 26495) FMT_CONSTEXPR buffer(grow_fun grow, size_t sz) noexcept - : size_(sz), capacity_(sz), grow_(grow) {} + : size_(sz), capacity_(sz), grow_(grow) { + if (FMT_MSC_VERSION != 0) ptr_ = nullptr; // Suppress warning 26495. + } constexpr buffer(grow_fun grow, T* p = nullptr, size_t sz = 0, size_t cap = 0) noexcept @@ -1846,13 +1820,8 @@ template class buffer { /// Appends data to the end of the buffer. template -// Workaround for MSVC2019 to fix error C2893: Failed to specialize function -// template 'void fmt::v11::detail::buffer::append(const U *,const U *)'. -#if !FMT_MSC_VERSION || FMT_MSC_VERSION >= 1940 - FMT_CONSTEXPR20 -#endif - void - append(const U* begin, const U* end) { + FMT_CONSTEXPR20 void append(const U* begin, const U* end) { + static_assert(std::is_same() || std::is_same(), ""); while (begin != end) { auto size = size_; auto free_cap = capacity_ - size; @@ -1865,7 +1834,7 @@ template class buffer { } // A loop is faster than memcpy on small sizes. T* out = ptr_ + size; - for (size_t i = 0; i < count; ++i) out[i] = begin[i]; + for (size_t i = 0; i < count; ++i) out[i] = static_cast(begin[i]); size_ += count; begin += count; } @@ -1875,7 +1844,7 @@ template class buffer { return ptr_[index]; } template - FMT_CONSTEXPR auto operator[](Idx index) const -> const T& { + constexpr auto operator[](Idx index) const -> const T& { return ptr_[index]; } }; @@ -1901,6 +1870,54 @@ class fixed_buffer_traits { } }; +template +struct has_append : std::false_type {}; + +template +struct has_append()) + .append(std::declval(), + std::declval()))>> + : std::true_type {}; + +template +struct has_insert : std::false_type {}; + +template +struct has_insert< + OutputIt, T, + void_t()) + .insert({}, std::declval(), std::declval()))>> + : std::true_type {}; + +// An optimized version of std::copy with the output value type (T). +template () && + has_append())> +FMT_CONSTEXPR auto copy(InputIt begin, InputIt end, OutputIt out) -> OutputIt { + get_container(out).append(begin, end); + return out; +} + +template () && + !has_append() && + has_insert())> +FMT_CONSTEXPR auto copy(InputIt begin, InputIt end, OutputIt out) -> OutputIt { + auto& c = get_container(out); + c.insert(c.end(), begin, end); + return out; +} + +template () || + !(has_append() || + has_insert()))> +FMT_CONSTEXPR auto copy(InputIt begin, InputIt end, OutputIt out) -> OutputIt { + while (begin != end) *out++ = static_cast(*begin++); + return out; +} + // A buffer that writes to an output iterator when flushed. template class iterator_buffer : public Traits, public buffer { @@ -1918,7 +1935,7 @@ class iterator_buffer : public Traits, public buffer { this->clear(); const T* begin = data_; const T* end = begin + this->limit(size); - while (begin != end) *out_++ = *begin++; + out_ = copy(begin, end, out_); } public: @@ -2045,7 +2062,7 @@ template class counting_buffer : public buffer { } public: - FMT_CONSTEXPR counting_buffer() : buffer(grow, data_, 0, buffer_size) {} + constexpr counting_buffer() : buffer(grow, data_, 0, buffer_size) {} constexpr auto count() const noexcept -> size_t { return count_ + this->size(); @@ -2055,66 +2072,6 @@ template class counting_buffer : public buffer { template struct is_back_insert_iterator> : std::true_type {}; -template -struct has_back_insert_iterator_container_append : std::false_type {}; -template -struct has_back_insert_iterator_container_append< - OutputIt, InputIt, - void_t()) - .append(std::declval(), - std::declval()))>> : std::true_type {}; - -template -struct has_back_insert_iterator_container_insert_at_end : std::false_type {}; - -template -struct has_back_insert_iterator_container_insert_at_end< - OutputIt, InputIt, - void_t()) - .insert(get_container(std::declval()).end(), - std::declval(), - std::declval()))>> : std::true_type {}; - -// An optimized version of std::copy with the output value type (T). -template ::value&& - has_back_insert_iterator_container_append< - OutputIt, InputIt>::value)> -FMT_CONSTEXPR20 auto copy(InputIt begin, InputIt end, OutputIt out) - -> OutputIt { - get_container(out).append(begin, end); - return out; -} - -template ::value && - !has_back_insert_iterator_container_append< - OutputIt, InputIt>::value && - has_back_insert_iterator_container_insert_at_end< - OutputIt, InputIt>::value)> -FMT_CONSTEXPR20 auto copy(InputIt begin, InputIt end, OutputIt out) - -> OutputIt { - auto& c = get_container(out); - c.insert(c.end(), begin, end); - return out; -} - -template ::value && - (has_back_insert_iterator_container_append< - OutputIt, InputIt>::value || - has_back_insert_iterator_container_insert_at_end< - OutputIt, InputIt>::value)))> -FMT_CONSTEXPR auto copy(InputIt begin, InputIt end, OutputIt out) -> OutputIt { - while (begin != end) *out++ = static_cast(*begin++); - return out; -} - -template -FMT_CONSTEXPR auto copy(basic_string_view s, OutputIt out) -> OutputIt { - return copy(s.begin(), s.end(), out); -} - template struct is_buffer_appender : std::false_type {}; template @@ -2184,9 +2141,9 @@ template class value { int int_value; unsigned uint_value; long long long_long_value; - unsigned long long ulong_long_value; - int128_opt int128_value; - uint128_opt uint128_value; + ullong ulong_long_value; + native_int128 int128_value; + native_uint128 uint128_value; bool bool_value; char_type char_value; float float_value; @@ -2205,25 +2162,15 @@ template class value { constexpr FMT_INLINE value(unsigned short x FMT_BUILTIN) : uint_value(x) {} constexpr FMT_INLINE value(int x) : int_value(x) {} constexpr FMT_INLINE value(unsigned x FMT_BUILTIN) : uint_value(x) {} - FMT_CONSTEXPR FMT_INLINE value(long x FMT_BUILTIN) : value(long_type(x)) {} - FMT_CONSTEXPR FMT_INLINE value(unsigned long x FMT_BUILTIN) + constexpr FMT_INLINE value(long x FMT_BUILTIN) : value(long_type(x)) {} + constexpr FMT_INLINE value(unsigned long x FMT_BUILTIN) : value(ulong_type(x)) {} constexpr FMT_INLINE value(long long x FMT_BUILTIN) : long_long_value(x) {} - constexpr FMT_INLINE value(unsigned long long x FMT_BUILTIN) - : ulong_long_value(x) {} - FMT_INLINE value(int128_opt x FMT_BUILTIN) : int128_value(x) {} - FMT_INLINE value(uint128_opt x FMT_BUILTIN) : uint128_value(x) {} + constexpr FMT_INLINE value(ullong x FMT_BUILTIN) : ulong_long_value(x) {} + FMT_INLINE value(native_int128 x FMT_BUILTIN) : int128_value(x) {} + FMT_INLINE value(native_uint128 x FMT_BUILTIN) : uint128_value(x) {} constexpr FMT_INLINE value(bool x FMT_BUILTIN) : bool_value(x) {} - template - constexpr FMT_INLINE value(bitint x FMT_BUILTIN) : long_long_value(x) { - static_assert(N <= 64, "unsupported _BitInt"); - } - template - constexpr FMT_INLINE value(ubitint x FMT_BUILTIN) : ulong_long_value(x) { - static_assert(N <= 64, "unsupported _BitInt"); - } - template ::value)> constexpr FMT_INLINE value(T x FMT_BUILTIN) : char_value(x) { static_assert( @@ -2252,17 +2199,20 @@ template class value { string.data = sv.data(); string.size = sv.size(); } - FMT_INLINE value(void* x FMT_BUILTIN) : pointer(x) {} - FMT_INLINE value(const void* x FMT_BUILTIN) : pointer(x) {} - FMT_INLINE value(volatile void* x FMT_BUILTIN) + constexpr FMT_INLINE value(void* x FMT_BUILTIN) : pointer(x) {} + constexpr FMT_INLINE value(const void* x FMT_BUILTIN) : pointer(x) {} + constexpr FMT_INLINE value(volatile void* x FMT_BUILTIN) : pointer(const_cast(x)) {} - FMT_INLINE value(const volatile void* x FMT_BUILTIN) + constexpr FMT_INLINE value(const volatile void* x FMT_BUILTIN) : pointer(const_cast(x)) {} - FMT_INLINE value(nullptr_t) : pointer(nullptr) {} + constexpr FMT_INLINE value(nullptr_t) : pointer(nullptr) {} - template ::value || - std::is_member_pointer::value)> - value(const T&) { + template ::value || + std::is_member_pointer::value) && + !std::is_void::type>::value)> + constexpr value(const T&) { // Formatting of arbitrary pointers is disallowed. If you want to format a // pointer cast it to `void*` or `const void*`. In particular, this forbids // formatting of `[const] volatile char*` printed as bool by iostreams. @@ -2271,16 +2221,16 @@ template class value { } template ::value)> - value(const T& x) : value(format_as(x)) {} + constexpr value(const T& x) : value(format_as(x)) {} template ::value)> - value(const T& x) : value(formatter::format_as(x)) {} + constexpr value(const T& x) : value(formatter::format_as(x)) {} template ::value)> - value(const T& named_arg) : value(named_arg.value) {} + constexpr value(const T& named_arg) : value(named_arg.value) {} template ::value || !FMT_BUILTIN_TYPES)> - FMT_CONSTEXPR20 FMT_INLINE value(T& x) : value(x, custom_tag()) {} + FMT_CONSTEXPR FMT_INLINE value(T& x) : value(x, custom_tag()) {} FMT_ALWAYS_INLINE value(const named_arg_info* args, size_t size) : named_args{args, size} {} @@ -2306,7 +2256,7 @@ template class value { template ())> FMT_CONSTEXPR value(const T&, custom_tag) { // Cannot format an argument; to make type T formattable provide a - // formatter specialization: https://fmt.dev/latest/api.html#udt. + // formatter specialization: https://fmt.dev/latest/api#udt. type_is_unformattable_for _; } @@ -2327,8 +2277,8 @@ template class value { enum { packed_arg_bits = 4 }; // Maximum number of arguments with packed types. enum { max_packed_args = 62 / packed_arg_bits }; -enum : unsigned long long { is_unpacked_bit = 1ULL << 63 }; -enum : unsigned long long { has_named_args_bit = 1ULL << 62 }; +enum : ullong { is_unpacked_bit = 1ULL << 63 }; +enum : ullong { has_named_args_bit = 1ULL << 62 }; template struct is_output_iterator : std::false_type {}; @@ -2341,18 +2291,16 @@ struct is_output_iterator< enable_if_t&>()++), T>::value>> : std::true_type {}; -template constexpr auto encode_types() -> unsigned long long { - return 0; -} +template constexpr auto encode_types() -> ullong { return 0; } template -constexpr auto encode_types() -> unsigned long long { - return static_cast(stored_type_constant::value) | +constexpr auto encode_types() -> ullong { + return unsigned(stored_type_constant::value) | (encode_types() << packed_arg_bits); } template -constexpr auto make_descriptor() -> unsigned long long { +constexpr auto make_descriptor() -> ullong { return NUM_ARGS <= max_packed_args ? encode_types() : is_unpacked_bit | NUM_ARGS; } @@ -2361,13 +2309,11 @@ template using arg_t = conditional_t, basic_format_arg>; -template +template struct named_arg_store { // args_[0].named_args points to named_args to avoid bloating format_args. - arg_t args[1u + NUM_ARGS]; - named_arg_info - named_args[static_cast(NUM_NAMED_ARGS)]; + arg_t args[NUM_ARGS + 1u]; + named_arg_info named_args[NUM_NAMED_ARGS + 0u]; template FMT_CONSTEXPR FMT_ALWAYS_INLINE named_arg_store(T&... values) @@ -2394,8 +2340,7 @@ struct named_arg_store { // An array of references to arguments. It can be implicitly converted to // `basic_format_args` for passing into type-erased formatting functions // such as `vformat`. It is a plain struct to reduce binary size in debug mode. -template +template struct format_arg_store { // +1 to workaround a bug in gcc 7.5 that causes duplicated-branches warning. using type = @@ -2411,12 +2356,10 @@ template struct native_formatter { dynamic_format_specs specs_; public: - using nonlocking = void; - FMT_CONSTEXPR auto parse(parse_context& ctx) -> const Char* { if (ctx.begin() == ctx.end() || *ctx.begin() == '}') return ctx.begin(); auto end = parse_format_specs(ctx.begin(), ctx.end(), specs_, ctx, TYPE); - if (const_check(TYPE == type::char_type)) check_char_specs(specs_); + if FMT_CONSTEXPR20 (TYPE == type::char_type) check_char_specs(specs_); return end; } @@ -2427,25 +2370,26 @@ template struct native_formatter { specs_.set_type(set ? presentation_type::debug : presentation_type::none); } - FMT_PRAGMA_CLANG(diagnostic ignored "-Wundefined-inline") template FMT_CONSTEXPR auto format(const T& val, FormatContext& ctx) const -> decltype(ctx.out()); }; -template -struct locking - : bool_constant::value == type::custom_type> {}; -template -struct locking>::nonlocking>> - : std::false_type {}; +template constexpr bool enforce_compile_checks() { +#ifdef FMT_ENFORCE_COMPILE_STRING + static_assert( + FMT_USE_CONSTEVAL && B, + "FMT_ENFORCE_COMPILE_STRING requires format strings to use FMT_STRING"); +#endif + return true; +} -template FMT_CONSTEXPR inline auto is_locking() -> bool { - return locking::value; +template constexpr auto is_locking() -> bool { + return locking>::value; } template -FMT_CONSTEXPR inline auto is_locking() -> bool { - return locking::value || is_locking(); +constexpr auto is_locking() -> bool { + return locking>::value || is_locking(); } FMT_API void vformat_to(buffer& buf, string_view fmt, format_args args, @@ -2460,6 +2404,9 @@ inline void vprint_mojibake(FILE*, string_view, const format_args&, bool) {} // The main public API. +template +using named_arg = detail::named_arg; + template FMT_CONSTEXPR void parse_context::do_check_arg_id(int arg_id) { // Argument id is only checked at compile time during parsing because @@ -2488,15 +2435,15 @@ template class basic_appender { public: using container_type = detail::buffer; - FMT_CONSTEXPR basic_appender(detail::buffer& buf) : container(&buf) {} + constexpr basic_appender(detail::buffer& buf) : container(&buf) {} - FMT_CONSTEXPR20 auto operator=(T c) -> basic_appender& { + FMT_CONSTEXPR auto operator=(T c) -> basic_appender& { container->push_back(c); return *this; } - FMT_CONSTEXPR20 auto operator*() -> basic_appender& { return *this; } - FMT_CONSTEXPR20 auto operator++() -> basic_appender& { return *this; } - FMT_CONSTEXPR20 auto operator++(int) -> basic_appender { return *this; } + FMT_CONSTEXPR auto operator*() -> basic_appender& { return *this; } + FMT_CONSTEXPR auto operator++() -> basic_appender& { return *this; } + FMT_CONSTEXPR auto operator++(int) -> basic_appender { return *this; } }; // A formatting argument. Context is a template parameter for the compiled API @@ -2588,7 +2535,7 @@ template class basic_format_args { // If the number of arguments is less or equal to max_packed_args then // argument types are passed in the descriptor. This reduces binary code size // per formatting function call. - unsigned long long desc_; + ullong desc_; union { // If is_packed() returns true then argument values are stored in values_; // otherwise they are stored in args_. This is done to improve cache @@ -2612,7 +2559,7 @@ template class basic_format_args { return static_cast((desc_ >> shift) & mask); } - template + template using store = detail::format_arg_store; @@ -2622,14 +2569,14 @@ template class basic_format_args { constexpr basic_format_args() : desc_(0), args_(nullptr) {} /// Constructs a `basic_format_args` object from `format_arg_store`. - template constexpr FMT_ALWAYS_INLINE basic_format_args( const store& s) : desc_(DESC | (NUM_NAMED_ARGS != 0 ? +detail::has_named_args_bit : 0)), values_(s.args) {} - template detail::max_packed_args)> constexpr basic_format_args(const store& s) : desc_(DESC | (NUM_NAMED_ARGS != 0 ? +detail::has_named_args_bit : 0)), @@ -2646,10 +2593,10 @@ template class basic_format_args { FMT_CONSTEXPR auto get(int id) const -> format_arg { auto arg = format_arg(); if (!is_packed()) { - if (id < max_size()) arg = args_[id]; + if (unsigned(id) < unsigned(max_size())) arg = args_[id]; return arg; } - if (static_cast(id) >= detail::max_packed_args) return arg; + if (unsigned(id) >= detail::max_packed_args) return arg; arg.type_ = type(id); if (arg.type_ != detail::type::none_type) arg.value_ = values_[id]; return arg; @@ -2673,9 +2620,8 @@ template class basic_format_args { } auto max_size() const -> int { - unsigned long long max_packed = detail::max_packed_args; - return static_cast(is_packed() ? max_packed - : desc_ & ~detail::is_unpacked_bit); + return int(is_packed() ? ullong(detail::max_packed_args) + : desc_ & ~detail::is_unpacked_bit); } }; @@ -2694,7 +2640,7 @@ class context { /// Constructs a `context` object. References to the arguments are stored /// in the object so make sure they have appropriate lifetimes. - FMT_CONSTEXPR context(iterator out, format_args args, locale_ref loc = {}) + constexpr context(iterator out, format_args args, locale_ref loc = {}) : out_(out), args_(args), loc_(loc) {} context(context&&) = default; context(const context&) = delete; @@ -2710,12 +2656,12 @@ class context { auto args() const -> const format_args& { return args_; } // Returns an iterator to the beginning of the output range. - FMT_CONSTEXPR auto out() const -> iterator { return out_; } + constexpr auto out() const -> iterator { return out_; } // Advances the begin iterator to `it`. FMT_CONSTEXPR void advance_to(iterator) {} - FMT_CONSTEXPR auto locale() const -> locale_ref { return loc_; } + constexpr auto locale() const -> locale_ref { return loc_; } }; template struct runtime_format_string { @@ -2740,7 +2686,7 @@ template struct fstring { detail::count_static_named_args(); using checker = detail::format_string_checker< - char, static_cast(sizeof...(T)), num_static_named_args, + char, int(sizeof...(T)), num_static_named_args, num_static_named_args != detail::count_named_args()>; using arg_pack = detail::arg_pack; @@ -2756,38 +2702,30 @@ template struct fstring { static_assert(count<(is_view>::value && std::is_reference::value)...>() == 0, "passing views as lvalues is disallowed"); - if (FMT_USE_CONSTEVAL) parse_format_string(s, checker(s, arg_pack())); -#ifdef FMT_ENFORCE_COMPILE_STRING - static_assert( - FMT_USE_CONSTEVAL && sizeof(s) != 0, - "FMT_ENFORCE_COMPILE_STRING requires format strings to use FMT_STRING"); -#endif + if (FMT_USE_CONSTEVAL) + parse_format_string(str, checker(str, arg_pack())); + constexpr bool unused = detail::enforce_compile_checks(); + (void)unused; } template ::value)> FMT_CONSTEVAL FMT_ALWAYS_INLINE fstring(const S& s) : str(s) { - auto sv = string_view(str); if (FMT_USE_CONSTEVAL) - detail::parse_format_string(sv, checker(sv, arg_pack())); -#ifdef FMT_ENFORCE_COMPILE_STRING - static_assert( - FMT_USE_CONSTEVAL && sizeof(s) != 0, - "FMT_ENFORCE_COMPILE_STRING requires format strings to use FMT_STRING"); -#endif + detail::parse_format_string(str, checker(str, arg_pack())); + constexpr bool unused = detail::enforce_compile_checks(); + (void)unused; } template ::value&& std::is_same::value)> FMT_ALWAYS_INLINE fstring(const S&) : str(S()) { FMT_CONSTEXPR auto sv = string_view(S()); - FMT_CONSTEXPR int unused = - (parse_format_string(sv, checker(sv, arg_pack())), 0); - detail::ignore_unused(unused); + FMT_CONSTEXPR int x = (parse_format_string(sv, checker(sv, arg_pack())), 0); + detail::ignore_unused(x); } fstring(runtime_format_string<> fmt) : str(fmt.str) {} - // Returning by reference generates better code in debug mode. - FMT_ALWAYS_INLINE operator const string_view&() const { return str; } + FMT_DEPRECATED operator const string_view&() const { return str; } auto get() const -> string_view { return str; } }; @@ -2797,7 +2735,7 @@ template using is_formattable = bool_constant::value, int*, T>, Char>, void>::value>; -#ifdef __cpp_concepts +#if defined(__cpp_concepts) && __cpp_concepts >= 201907L template concept formattable = is_formattable, Char>::value; #endif @@ -2818,19 +2756,17 @@ struct formatter(), - unsigned long long DESC = detail::make_descriptor()> + ullong DESC = detail::make_descriptor()> constexpr FMT_ALWAYS_INLINE auto make_format_args(T&... args) -> detail::format_arg_store { - // Suppress warnings for pathological types convertible to detail::value. - FMT_PRAGMA_GCC(diagnostic ignored "-Wconversion") return {{args...}}; } template using vargs = - detail::format_arg_store(), detail::make_descriptor()>; @@ -2841,9 +2777,13 @@ using vargs = * **Example**: * * fmt::print("The answer is {answer}.", fmt::arg("answer", 42)); + * + * Named arguments passed with `fmt::arg` are not supported + * in compile-time checks, but `"answer"_a=42` are compile-time checked in + * sufficiently new compilers. See `operator""_a()`. */ -template -inline auto arg(const Char* name, const T& arg) -> detail::named_arg { +template +inline auto arg(const char* name, const T& arg) -> named_arg { return {name, arg}; } @@ -2851,6 +2791,7 @@ inline auto arg(const Char* name, const T& arg) -> detail::named_arg { template , char>::value)> +// DEPRECATED! Passing out as a forwarding reference. auto vformat_to(OutputIt&& out, string_view fmt, format_args args) -> remove_cvref_t { auto&& buf = detail::get_buffer(out); @@ -2877,10 +2818,8 @@ FMT_INLINE auto format_to(OutputIt&& out, format_string fmt, T&&... args) } template struct format_to_n_result { - /// Iterator past the end of the output range. - OutputIt out; - /// Total (not truncated) output size. - size_t size; + OutputIt out; ///< Iterator past the end of the output range. + size_t size; ///< Total (not truncated) output size. }; template fmt, } struct format_to_result { - /// Pointer to just after the last successful write in the array. - char* out; - /// Specifies if the output was truncated. - bool truncated; + char* out; ///< Pointer to just after the last successful write. + bool truncated; ///< Specifies if the output was truncated. FMT_CONSTEXPR operator char*() const { // Report truncation to prevent silent data loss. @@ -2920,8 +2857,8 @@ struct format_to_result { }; template -auto vformat_to(char (&out)[N], string_view fmt, format_args args) - -> format_to_result { +FMT_DEPRECATED auto vformat_to(char (&out)[N], string_view fmt, + format_args args) -> format_to_result { auto result = vformat_to_n(out, N, fmt, args); return {result.out, result.size > N}; } @@ -2958,10 +2895,10 @@ FMT_API void vprint_buffered(FILE* f, string_view fmt, format_args args); template FMT_INLINE void print(format_string fmt, T&&... args) { vargs va = {{args...}}; - if (detail::const_check(!detail::use_utf8)) + if FMT_CONSTEXPR20 (!detail::use_utf8) return detail::vprint_mojibake(stdout, fmt.str, va, false); - return detail::is_locking() ? vprint_buffered(stdout, fmt.str, va) - : vprint(fmt.str, va); + detail::is_locking() ? vprint_buffered(stdout, fmt.str, va) + : vprint(fmt.str, va); } /** @@ -2975,10 +2912,10 @@ FMT_INLINE void print(format_string fmt, T&&... args) { template FMT_INLINE void print(FILE* f, format_string fmt, T&&... args) { vargs va = {{args...}}; - if (detail::const_check(!detail::use_utf8)) + if FMT_CONSTEXPR20 (!detail::use_utf8) return detail::vprint_mojibake(f, fmt.str, va, false); - return detail::is_locking() ? vprint_buffered(f, fmt.str, va) - : vprint(f, fmt.str, va); + detail::is_locking() ? vprint_buffered(f, fmt.str, va) + : vprint(f, fmt.str, va); } /// Formats `args` according to specifications in `fmt` and writes the output @@ -2986,20 +2923,17 @@ FMT_INLINE void print(FILE* f, format_string fmt, T&&... args) { template FMT_INLINE void println(FILE* f, format_string fmt, T&&... args) { vargs va = {{args...}}; - return detail::const_check(detail::use_utf8) - ? vprintln(f, fmt.str, va) - : detail::vprint_mojibake(f, fmt.str, va, true); + if FMT_CONSTEXPR20 (detail::use_utf8) return vprintln(f, fmt.str, va); + detail::vprint_mojibake(f, fmt.str, va, true); } /// Formats `args` according to specifications in `fmt` and writes the output /// to `stdout` followed by a newline. template FMT_INLINE void println(format_string fmt, T&&... args) { - return fmt::println(stdout, fmt, static_cast(args)...); + fmt::println(stdout, fmt, static_cast(args)...); } -FMT_PRAGMA_GCC(diagnostic pop) -FMT_PRAGMA_CLANG(diagnostic pop) FMT_PRAGMA_GCC(pop_options) FMT_END_EXPORT FMT_END_NAMESPACE diff --git a/dep/fmt/include/fmt/chrono.h b/dep/fmt/include/fmt/chrono.h index 9fbeeed67..e4bc1ce4f 100644 --- a/dep/fmt/include/fmt/chrono.h +++ b/dep/fmt/include/fmt/chrono.h @@ -1,6 +1,6 @@ // Formatting library for C++ - chrono support // -// Copyright (c) 2012 - present, Victor Zverovich +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -52,7 +52,7 @@ FMT_CONSTEXPR auto lossless_integral_conversion(const From from, int& ec) static_assert(T::is_integer, "To must be integral"); // A and B are both signed, or both unsigned. - if (detail::const_check(F::digits <= T::digits)) { + if FMT_CONSTEXPR20 (F::digits <= T::digits) { // From fits in To without any problem. } else { // From does not always fit in To, resort to a dynamic check. @@ -79,22 +79,21 @@ FMT_CONSTEXPR auto lossless_integral_conversion(const From from, int& ec) static_assert(F::is_integer, "From must be integral"); static_assert(T::is_integer, "To must be integral"); - if (detail::const_check(F::is_signed && !T::is_signed)) { + if FMT_CONSTEXPR20 (F::is_signed && !T::is_signed) { // From may be negative, not allowed! if (fmt::detail::is_negative(from)) { ec = 1; return {}; } // From is positive. Can it always fit in To? - if (detail::const_check(F::digits > T::digits) && + if (F::digits > T::digits && from > static_cast(detail::max_value())) { ec = 1; return {}; } } - if (detail::const_check(!F::is_signed && T::is_signed && - F::digits >= T::digits) && + if (!F::is_signed && T::is_signed && F::digits >= T::digits && from > static_cast(detail::max_value())) { ec = 1; return {}; @@ -188,7 +187,7 @@ auto safe_duration_cast(std::chrono::duration from, } // multiply with Factor::num without overflow or underflow - if (detail::const_check(Factor::num != 1)) { + if FMT_CONSTEXPR20 (Factor::num != 1) { constexpr auto max1 = detail::max_value() / static_cast(Factor::num); if (count > max1) { @@ -205,7 +204,7 @@ auto safe_duration_cast(std::chrono::duration from, } // this can't go wrong, right? den>0 is checked earlier. - if (detail::const_check(Factor::den != 1)) { + if FMT_CONSTEXPR20 (Factor::den != 1) { using common_t = typename std::common_type::type; count /= static_cast(Factor::den); } @@ -337,7 +336,7 @@ void write_codecvt(codecvt_result& out, string_view in, template auto write_encoded_tm_str(OutputIt out, string_view in, const std::locale& loc) -> OutputIt { - if (const_check(detail::use_utf8) && loc != get_classic_locale()) { + if (detail::use_utf8 && loc != get_classic_locale()) { // char16_t and char32_t codecvts are broken in MSVC (linkage errors) and // gcc-4. #if FMT_MSC_VERSION != 0 || \ @@ -434,14 +433,14 @@ auto duration_cast(std::chrono::duration from) -> To { common_rep count = from.count(); // This conversion is lossless. // Multiply from.count() by factor and check for overflow. - if (const_check(factor::num != 1)) { + if FMT_CONSTEXPR20 (factor::num != 1) { if (count > max_value() / factor::num) throw_duration_error(); const auto min = (std::numeric_limits::min)() / factor::num; - if (const_check(!std::is_unsigned::value) && count < min) + if (!std::is_unsigned::value && count < min) throw_duration_error(); count *= factor::num; } - if (const_check(factor::den != 1)) count /= factor::den; + if FMT_CONSTEXPR20 (factor::den != 1) count /= factor::den; int ec = 0; auto to = To(safe_duration_cast::lossless_integral_conversion( @@ -544,8 +543,7 @@ namespace detail { // https://johnnylee-sde.github.io/Fast-unsigned-integer-to-time-string/. inline void write_digit2_separated(char* buf, unsigned a, unsigned b, unsigned c, char sep) { - unsigned long long digits = - a | (b << 24) | (static_cast(c) << 48); + ullong digits = a | (b << 24) | (static_cast(c) << 48); // Convert each value to BCD. // We have x = a * 10 + b and we want to convert it to BCD y = a * 16 + b. // The difference is @@ -559,12 +557,12 @@ inline void write_digit2_separated(char* buf, unsigned a, unsigned b, // Put low nibbles to high bytes and high nibbles to low bytes. digits = ((digits & 0x00f00000f00000f0) >> 4) | ((digits & 0x000f00000f00000f) << 8); - auto usep = static_cast(sep); + auto usep = static_cast(sep); // Add ASCII '0' to each digit byte and insert separators. digits |= 0x3030003030003030 | (usep << 16) | (usep << 40); constexpr size_t len = 8; - if (const_check(is_big_endian())) { + if (is_big_endian()) { char tmp[len]; std::memcpy(tmp, &digits, len); std::reverse_copy(tmp, tmp + len, buf); @@ -1194,6 +1192,7 @@ class tm_writer { template ::value)> void format_tz_name(const T& tm) { + if (!tm.tm_zone) FMT_THROW(format_error("no timezone")); out_ = write_tm_str(out_, tm.tm_zone, loc_); } template ::value)> @@ -1576,7 +1575,7 @@ auto format_duration_unit(OutputIt out) -> OutputIt { return copy_unit(string_view(unit), out, Char()); *out++ = '['; out = write(out, Period::num); - if (const_check(Period::den != 1)) { + if FMT_CONSTEXPR20 (Period::den != 1) { *out++ = '/'; out = write(out, Period::den); } @@ -2179,9 +2178,9 @@ struct formatter, Char> : private formatter { -> decltype(ctx.out()) { std::tm tm = gmtime(val); using period = typename Duration::period; - if (detail::const_check( - period::num == 1 && period::den == 1 && - !std::is_floating_point::value)) { + if FMT_CONSTEXPR20 (period::num == 1 && period::den == 1 && + !std::is_floating_point< + typename Duration::rep>::value) { detail::set_tm_zone(tm, detail::utc()); return formatter::format(tm, ctx); } diff --git a/dep/fmt/include/fmt/color.h b/dep/fmt/include/fmt/color.h index 2cbc53ca3..bf0c32d60 100644 --- a/dep/fmt/include/fmt/color.h +++ b/dep/fmt/include/fmt/color.h @@ -1,6 +1,6 @@ // Formatting library for C++ - color support // -// Copyright (c) 2018 - present, Victor Zverovich and fmt contributors +// Copyright (c) 2018 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -155,7 +155,7 @@ enum class color : uint32_t { white_smoke = 0xF5F5F5, // rgb(245,245,245) yellow = 0xFFFF00, // rgb(255,255,0) yellow_green = 0x9ACD32 // rgb(154,205,50) -}; // enum class color +}; // enum class color enum class terminal_color : uint8_t { black = 30, @@ -471,7 +471,7 @@ template inline void reset_color(buffer& buffer) { template struct styled_arg : view { const T& value; text_style style; - styled_arg(const T& v, text_style s) : value(v), style(s) {} + FMT_CONSTEXPR styled_arg(const T& v, text_style s) : value(v), style(s) {} }; template @@ -528,6 +528,42 @@ void print(text_style ts, format_string fmt, T&&... args) { return print(stdout, ts, fmt, std::forward(args)...); } +inline void vprintln(FILE* f, text_style ts, string_view fmt, + format_args args) { + auto buf = memory_buffer(); + detail::vformat_to(buf, ts, fmt, args); + buf.push_back('\n'); + print(f, FMT_STRING("{}"), string_view(buf.begin(), buf.size())); +} + +/** + * Formats a string and prints it to the specified file stream followed by a + * newline, using ANSI escape sequences to specify text formatting. + * + * **Example**: + * + * fmt::println(fmt::emphasis::bold | fg(fmt::color::red), + * "Elapsed time: {0:.2f} seconds", 1.23); + */ +template +void println(FILE* f, text_style ts, format_string fmt, T&&... args) { + vprintln(f, ts, fmt.str, vargs{{args...}}); +} + +/** + * Formats a string and prints it to stdout followed by a newline, using ANSI + * escape sequences to specify text formatting. + * + * **Example**: + * + * fmt::println(fmt::emphasis::bold | fg(fmt::color::red), + * "Elapsed time: {0:.2f} seconds", 1.23); + */ +template +void println(text_style ts, format_string fmt, T&&... args) { + return println(stdout, ts, fmt, std::forward(args)...); +} + inline auto vformat(text_style ts, string_view fmt, format_args args) -> std::string { auto buf = memory_buffer(); @@ -583,8 +619,8 @@ inline auto format_to(OutputIt out, text_style ts, format_string fmt, template struct formatter, Char> : formatter { template - auto format(const detail::styled_arg& arg, FormatContext& ctx) const - -> decltype(ctx.out()) { + FMT_CONSTEXPR auto format(const detail::styled_arg& arg, + FormatContext& ctx) const -> decltype(ctx.out()) { const auto& ts = arg.style; auto out = ctx.out(); diff --git a/dep/fmt/include/fmt/compile.h b/dep/fmt/include/fmt/compile.h index 64eb7a20d..1a987cb08 100644 --- a/dep/fmt/include/fmt/compile.h +++ b/dep/fmt/include/fmt/compile.h @@ -1,6 +1,6 @@ // Formatting library for C++ - experimental format string compilation // -// Copyright (c) 2012 - present, Victor Zverovich and fmt contributors +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -267,13 +267,15 @@ constexpr auto parse_text(basic_string_view str, size_t pos) -> size_t { return pos; } -template +template constexpr auto compile_format_string(S fmt); -template +template constexpr auto parse_tail(T head, S fmt) { if constexpr (POS != basic_string_view(fmt).size()) { - constexpr auto tail = compile_format_string(fmt); + constexpr auto tail = + compile_format_string(fmt); if constexpr (std::is_same, unknown_format>()) return tail; @@ -347,13 +349,13 @@ struct field_type::value>> { }; template + bool DYNAMIC_NAMES, typename S> constexpr auto parse_replacement_field_then_tail(S fmt) { using char_type = typename S::char_type; constexpr auto str = basic_string_view(fmt); constexpr char_type c = END_POS != str.size() ? str[END_POS] : char_type(); if constexpr (c == '}') { - return parse_tail( + return parse_tail( field::type, ARG_INDEX>(), fmt); } else if constexpr (c != ':') { FMT_THROW(format_error("expected ':'")); @@ -364,7 +366,8 @@ constexpr auto parse_replacement_field_then_tail(S fmt) { FMT_THROW(format_error("expected '}'")); return 0; } else { - return parse_tail( + return parse_tail( spec_field::type, ARG_INDEX>{ result.fmt}, fmt); @@ -374,7 +377,7 @@ constexpr auto parse_replacement_field_then_tail(S fmt) { // Compiles a non-empty format string and returns the compiled representation // or unknown_format() on unrecognized input. -template +template constexpr auto compile_format_string(S fmt) { using char_type = typename S::char_type; constexpr auto str = basic_string_view(fmt); @@ -382,14 +385,15 @@ constexpr auto compile_format_string(S fmt) { if constexpr (POS + 1 == str.size()) FMT_THROW(format_error("unmatched '{' in format string")); if constexpr (str[POS + 1] == '{') { - return parse_tail(make_text(str, POS, 1), fmt); + return parse_tail( + make_text(str, POS, 1), fmt); } else if constexpr (str[POS + 1] == '}' || str[POS + 1] == ':') { static_assert(ID != manual_indexing_id, "cannot switch from manual to automatic argument indexing"); constexpr auto next_id = ID != manual_indexing_id ? ID + 1 : manual_indexing_id; - return parse_replacement_field_then_tail, Args, - POS + 1, ID, next_id>(fmt); + return parse_replacement_field_then_tail< + get_type, Args, POS + 1, ID, next_id, DYNAMIC_NAMES>(fmt); } else { constexpr auto arg_id_result = parse_arg_id(str.data() + POS + 1, str.data() + str.size()); @@ -402,21 +406,24 @@ constexpr auto compile_format_string(S fmt) { ID == manual_indexing_id || ID == 0, "cannot switch from automatic to manual argument indexing"); constexpr auto arg_index = arg_id_result.arg_id.index; - return parse_replacement_field_then_tail, - Args, arg_id_end_pos, - arg_index, manual_indexing_id>( - fmt); + return parse_replacement_field_then_tail< + get_type, Args, arg_id_end_pos, arg_index, + manual_indexing_id, DYNAMIC_NAMES>(fmt); } else if constexpr (arg_id_result.kind == arg_id_kind::name) { constexpr auto arg_index = get_arg_index_by_name(arg_id_result.arg_id.name, Args{}); + + static_assert(arg_index >= 0 || DYNAMIC_NAMES, + "named argument not found"); + if constexpr (arg_index >= 0) { constexpr auto next_id = ID != manual_indexing_id ? ID + 1 : manual_indexing_id; return parse_replacement_field_then_tail< decltype(get_type::value), Args, arg_id_end_pos, - arg_index, next_id>(fmt); + arg_index, next_id, DYNAMIC_NAMES>(fmt); } else if constexpr (c == '}') { - return parse_tail( + return parse_tail( runtime_named_field{arg_id_result.arg_id.name}, fmt); } else if constexpr (c == ':') { return unknown_format(); // no type info for specs parsing @@ -426,13 +433,16 @@ constexpr auto compile_format_string(S fmt) { } else if constexpr (str[POS] == '}') { if constexpr (POS + 1 == str.size()) FMT_THROW(format_error("unmatched '}' in format string")); - return parse_tail(make_text(str, POS, 1), fmt); + return parse_tail(make_text(str, POS, 1), + fmt); } else { constexpr auto end = parse_text(str, POS + 1); if constexpr (end - POS > 1) { - return parse_tail(make_text(str, POS, end - POS), fmt); + return parse_tail( + make_text(str, POS, end - POS), fmt); } else { - return parse_tail(code_unit{str[POS]}, fmt); + return parse_tail( + code_unit{str[POS]}, fmt); } } } @@ -444,8 +454,11 @@ constexpr auto compile(S fmt) { if constexpr (str.size() == 0) { return detail::make_text(str, 0, 0); } else { - constexpr auto result = - detail::compile_format_string, 0, 0>(fmt); + constexpr int num_static_named_args = + detail::count_static_named_args(); + constexpr auto result = detail::compile_format_string< + detail::type_list, 0, 0, + num_static_named_args != detail::count_named_args()>(fmt); return result; } } @@ -522,7 +535,7 @@ auto format_to_n(OutputIt out, size_t n, const S& fmt, T&&... args) -> format_to_n_result { using traits = detail::fixed_buffer_traits; auto buf = detail::iterator_buffer(out, n); - fmt::format_to(std::back_inserter(buf), fmt, std::forward(args)...); + fmt::format_to(appender(buf), fmt, std::forward(args)...); return {buf.out(), buf.count()}; } @@ -559,8 +572,8 @@ template class static_format_result { *fmt::format_to(data, fmt, std::forward(args)...) = '\0'; } - auto str() const -> fmt::string_view { return {data, N - 1}; } - auto c_str() const -> const char* { return data; } + FMT_CONSTEXPR auto str() const -> fmt::string_view { return {data, N - 1}; } + FMT_CONSTEXPR auto c_str() const -> const char* { return data; } }; /** diff --git a/dep/fmt/include/fmt/core.h b/dep/fmt/include/fmt/core.h index 8ca735f0c..eff2ae89a 100644 --- a/dep/fmt/include/fmt/core.h +++ b/dep/fmt/include/fmt/core.h @@ -1,5 +1,14 @@ -// This file is only provided for compatibility and may be removed in future -// versions. Use fmt/base.h if you don't need fmt::format and fmt/format.h -// otherwise. +// Formatting library for C++ - core API +// +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors +// All rights reserved. +// +// For the license information refer to format.h. -#include "format.h" +#include "base.h" + +// Using fmt::format via fmt/core.h has been deprecated since version 11 +// and now requires an explicit opt in. +#ifdef FMT_DEPRECATED_HEAVY_CORE +# include "format.h" +#endif diff --git a/dep/fmt/include/fmt/fmt-c.h b/dep/fmt/include/fmt/fmt-c.h new file mode 100644 index 000000000..e918e77ca --- /dev/null +++ b/dep/fmt/include/fmt/fmt-c.h @@ -0,0 +1,201 @@ +// Formatting library for C++ - the C API +// +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors +// All rights reserved. +// +// For the license information refer to format.h. + +#ifndef FMT_C_H_ +#define FMT_C_H_ + +#include // bool +#include // size_t +#include // FILE + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + fmt_int = 1, + fmt_uint, + fmt_bool = 7, + fmt_char, + fmt_float, + fmt_double, + fmt_long_double, + fmt_cstring, + fmt_pointer = 14 +} fmt_type; + +typedef struct { + fmt_type type; + union { + long long int_value; + unsigned long long uint_value; // Used for FMT_PTR and custom data + bool bool_value; + char char_value; + float float_value; + double double_value; + long double long_double_value; + const char* cstring; + const void* pointer; + } value; +} fmt_arg; + +enum { fmt_error = -1, fmt_error_invalid_arg = -2 }; + +int fmt_vformat(char* buffer, size_t size, const char* fmt, const fmt_arg* args, + size_t num_args); +int fmt_vprint(FILE* stream, const char* fmt, const fmt_arg* args, + size_t num_args); + +#ifdef __cplusplus +} +#endif + +#ifndef __cplusplus + +static inline fmt_arg fmt_from_int(long long x) { + return (fmt_arg){.type = fmt_int, .value.int_value = x}; +} + +static inline fmt_arg fmt_from_uint(unsigned long long x) { + return (fmt_arg){.type = fmt_uint, .value.uint_value = x}; +} + +static inline fmt_arg fmt_from_bool(bool x) { + return (fmt_arg){.type = fmt_bool, .value.bool_value = x}; +} + +static inline fmt_arg fmt_from_char(char x) { + return (fmt_arg){.type = fmt_char, .value.char_value = x}; +} + +static inline fmt_arg fmt_from_float(float x) { + return (fmt_arg){.type = fmt_float, .value.float_value = x}; +} + +static inline fmt_arg fmt_from_double(double x) { + return (fmt_arg){.type = fmt_double, .value.double_value = x}; +} + +static inline fmt_arg fmt_from_long_double(long double x) { + return (fmt_arg){.type = fmt_long_double, .value.long_double_value = x}; +} + +static inline fmt_arg fmt_from_str(const char* x) { + return (fmt_arg){.type = fmt_cstring, .value.cstring = x}; +} + +static inline fmt_arg fmt_from_ptr(const void* x) { + return (fmt_arg){.type = fmt_pointer, .value.pointer = x}; +} + +void fmt_unsupported_type(void); + +# if !defined(_MSC_VER) || defined(__clang__) +typedef signed char fmt_signed_char; +# else +typedef enum {} fmt_signed_char; +# endif + +// Require modern MSVC with conformant preprocessor. +# if defined(_MSC_VER) && !defined(__clang__) && \ + (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL) +# error "C API requires MSVC 2019+ with /Zc:preprocessor flag." +# endif + +# define FMT_MAKE_ARG(x) \ + _Generic((x), \ + fmt_signed_char: fmt_from_int, \ + unsigned char: fmt_from_uint, \ + short: fmt_from_int, \ + unsigned short: fmt_from_uint, \ + int: fmt_from_int, \ + unsigned int: fmt_from_uint, \ + long: fmt_from_int, \ + unsigned long: fmt_from_uint, \ + long long: fmt_from_int, \ + unsigned long long: fmt_from_uint, \ + bool: fmt_from_bool, \ + char: fmt_from_char, \ + float: fmt_from_float, \ + double: fmt_from_double, \ + long double: fmt_from_long_double, \ + char*: fmt_from_str, \ + const char*: fmt_from_str, \ + void*: fmt_from_ptr, \ + const void*: fmt_from_ptr, \ + default: fmt_unsupported_type)(x) + +# define FMT_CAT(a, b) FMT_CAT_(a, b) +# define FMT_CAT_(a, b) a##b + +# define FMT_NARG_(_unused, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, \ + _12, _13, _14, _15, _16, N, ...) \ + N +# define FMT_NARG(_unused, ...) \ + FMT_NARG_(, ##__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, \ + 3, 2, 1, 0) + +# define FMT_MAP_0(...) +# define FMT_MAP_1(f, a) f(a) +# define FMT_MAP_2(f, a, b) f(a), f(b) +# define FMT_MAP_3(f, a, b, c) f(a), f(b), f(c) +# define FMT_MAP_4(f, a, b, c, d) f(a), f(b), f(c), f(d) +# define FMT_MAP_5(f, a, b, c, d, e) f(a), f(b), f(c), f(d), f(e) +# define FMT_MAP_6(f, a, b, c, d, e, g) f(a), f(b), f(c), f(d), f(e), f(g) +# define FMT_MAP_7(f, a, b, c, d, e, g, h) \ + f(a), f(b), f(c), f(d), f(e), f(g), f(h) +# define FMT_MAP_8(f, a, b, c, d, e, g, h, i) \ + f(a), f(b), f(c), f(d), f(e), f(g), f(h), f(i) +# define FMT_MAP_9(f, a, b, c, d, e, g, h, i, j) \ + f(a), f(b), f(c), f(d), f(e), f(g), f(h), f(i), f(j) +# define FMT_MAP_10(f, a, b, c, d, e, g, h, i, j, k) \ + f(a), f(b), f(c), f(d), f(e), f(g), f(h), f(i), f(j), f(k) +# define FMT_MAP_11(f, a, b, c, d, e, g, h, i, j, k, l) \ + f(a), f(b), f(c), f(d), f(e), f(g), f(h), f(i), f(j), f(k), f(l) +# define FMT_MAP_12(f, a, b, c, d, e, g, h, i, j, k, l, m) \ + f(a), f(b), f(c), f(d), f(e), f(g), f(h), f(i), f(j), f(k), f(l), f(m) +# define FMT_MAP_13(f, a, b, c, d, e, g, h, i, j, k, l, m, n) \ + f(a), f(b), f(c), f(d), f(e), f(g), f(h), f(i), f(j), f(k), f(l), f(m), f(n) +# define FMT_MAP_14(f, a, b, c, d, e, g, h, i, j, k, l, m, n, o) \ + f(a), f(b), f(c), f(d), f(e), f(g), f(h), f(i), f(j), f(k), f(l), f(m), \ + f(n), f(o) +# define FMT_MAP_15(f, a, b, c, d, e, g, h, i, j, k, l, m, n, o, p) \ + f(a), f(b), f(c), f(d), f(e), f(g), f(h), f(i), f(j), f(k), f(l), f(m), \ + f(n), f(o), f(p) +# define FMT_MAP_16(f, a, b, c, d, e, g, h, i, j, k, l, m, n, o, p, q) \ + f(a), f(b), f(c), f(d), f(e), f(g), f(h), f(i), f(j), f(k), f(l), f(m), \ + f(n), f(o), f(p), f(q) + +# define FMT_MAP(f, ...) \ + FMT_CAT(FMT_MAP_, FMT_NARG(, ##__VA_ARGS__))(f, ##__VA_ARGS__) + +// select between two expressions depending on whether __VA_ARGS__ is empty +// expands to e if __VA_ARGS__ is empty and n otherwise +# define FMT_VA_SELECT(e, n, ...) \ + FMT_NARG_(, ##__VA_ARGS__, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, n, \ + e) + +# define FMT_MAKE_NULL(...) NULL +# define FMT_MAKE_ARGLIST(...) \ + (fmt_arg[]) { FMT_MAP(FMT_MAKE_ARG, ##__VA_ARGS__) } +# define FMT_EXPAND(v) v + +# define FMT_FORMAT_ARGS(fmt, ...) \ + (fmt), \ + FMT_EXPAND(FMT_VA_SELECT(FMT_MAKE_NULL, FMT_MAKE_ARGLIST, \ + ##__VA_ARGS__)(__VA_ARGS__)), \ + FMT_NARG(, ##__VA_ARGS__) + +# define fmt_format(buffer, size, fmt, ...) \ + fmt_vformat((buffer), (size), FMT_FORMAT_ARGS((fmt), ##__VA_ARGS__)) + +# define fmt_print(stream, fmt, ...) \ + fmt_vprint((stream), FMT_FORMAT_ARGS((fmt), ##__VA_ARGS__)) + +#endif // __cplusplus + +#endif // FMT_C_H_ diff --git a/dep/fmt/include/fmt/format-inl.h b/dep/fmt/include/fmt/format-inl.h index 945cb912a..665f7308d 100644 --- a/dep/fmt/include/fmt/format-inl.h +++ b/dep/fmt/include/fmt/format-inl.h @@ -1,6 +1,6 @@ // Formatting library for C++ - implementation // -// Copyright (c) 2012 - 2016, Victor Zverovich +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -8,12 +8,17 @@ #ifndef FMT_FORMAT_INL_H_ #define FMT_FORMAT_INL_H_ +#ifdef __SANITIZE_THREAD__ +extern "C" void __tsan_acquire(void*); +extern "C" void __tsan_release(void*); +#endif + #ifndef FMT_MODULE +# include // ptrdiff_t + # include # include // errno -# include -# include -# include +# include // std::bad_alloc #endif #if defined(_WIN32) && !defined(FMT_USE_WRITE_CONSOLE) @@ -30,6 +35,14 @@ # define FMT_FUNC #endif +#if defined(FMT_USE_FULL_CACHE_DRAGONBOX) +// Use the provided definition. +#elif defined(__OPTIMIZE_SIZE__) +# define FMT_USE_FULL_CACHE_DRAGONBOX 0 +#else +# define FMT_USE_FULL_CACHE_DRAGONBOX 1 +#endif + FMT_BEGIN_NAMESPACE #ifndef FMT_CUSTOM_ASSERT_FAIL @@ -70,14 +83,19 @@ template auto locale_ref::get() const -> Locale { namespace detail { +FMT_FUNC auto allocate(size_t size) -> void* { + void* p = malloc(size); + if (!p) FMT_THROW(std::bad_alloc()); + return p; +} + FMT_FUNC void format_error_code(detail::buffer& out, int error_code, string_view message) noexcept { - // Report error code making sure that the output fits into - // inline_buffer_size to avoid dynamic memory allocation and potential - // bad_alloc. + // Report error code making sure that the output fits into inline_buffer_size + // to avoid dynamic memory allocation and potential bad_alloc. out.try_resize(0); - static const char SEP[] = ": "; - static const char ERROR_STR[] = "error "; + static constexpr char SEP[] = ": "; + static constexpr char ERROR_STR[] = "error "; // Subtract 2 to account for terminating null characters in SEP and ERROR_STR. size_t error_code_size = sizeof(SEP) + sizeof(ERROR_STR) - 2; auto abs_value = static_cast>(error_code); @@ -195,10 +213,9 @@ inline auto umul96_upper64(uint32_t x, uint64_t y) noexcept -> uint64_t { // Computes lower 128 bits of multiplication of a 64-bit unsigned integer and a // 128-bit unsigned integer. -inline auto umul192_lower128(uint64_t x, uint128_fallback y) noexcept - -> uint128_fallback { +inline auto umul192_lower128(uint64_t x, uint128 y) noexcept -> uint128 { uint64_t high = x * y.high(); - uint128_fallback high_low = umul128(x, y.low()); + uint128 high_low = umul128(x, y.low()); return {high + high_low.high(), high_low.low()}; } @@ -366,673 +383,673 @@ template <> struct cache_accessor { template <> struct cache_accessor { using carrier_uint = float_info::carrier_uint; - using cache_entry_type = uint128_fallback; + using cache_entry_type = uint128; - static auto get_cached_power(int k) noexcept -> uint128_fallback { + static auto get_cached_power(int k) noexcept -> uint128 { FMT_ASSERT(k >= float_info::min_k && k <= float_info::max_k, "k is out of range"); - static constexpr uint128_fallback pow10_significands[] = { + static constexpr uint128 pow10_significands[] = { #if FMT_USE_FULL_CACHE_DRAGONBOX - {0xff77b1fcbebcdc4f, 0x25e8e89c13bb0f7b}, - {0x9faacf3df73609b1, 0x77b191618c54e9ad}, - {0xc795830d75038c1d, 0xd59df5b9ef6a2418}, - {0xf97ae3d0d2446f25, 0x4b0573286b44ad1e}, - {0x9becce62836ac577, 0x4ee367f9430aec33}, - {0xc2e801fb244576d5, 0x229c41f793cda740}, - {0xf3a20279ed56d48a, 0x6b43527578c11110}, - {0x9845418c345644d6, 0x830a13896b78aaaa}, - {0xbe5691ef416bd60c, 0x23cc986bc656d554}, - {0xedec366b11c6cb8f, 0x2cbfbe86b7ec8aa9}, - {0x94b3a202eb1c3f39, 0x7bf7d71432f3d6aa}, - {0xb9e08a83a5e34f07, 0xdaf5ccd93fb0cc54}, - {0xe858ad248f5c22c9, 0xd1b3400f8f9cff69}, - {0x91376c36d99995be, 0x23100809b9c21fa2}, - {0xb58547448ffffb2d, 0xabd40a0c2832a78b}, - {0xe2e69915b3fff9f9, 0x16c90c8f323f516d}, - {0x8dd01fad907ffc3b, 0xae3da7d97f6792e4}, - {0xb1442798f49ffb4a, 0x99cd11cfdf41779d}, - {0xdd95317f31c7fa1d, 0x40405643d711d584}, - {0x8a7d3eef7f1cfc52, 0x482835ea666b2573}, - {0xad1c8eab5ee43b66, 0xda3243650005eed0}, - {0xd863b256369d4a40, 0x90bed43e40076a83}, - {0x873e4f75e2224e68, 0x5a7744a6e804a292}, - {0xa90de3535aaae202, 0x711515d0a205cb37}, - {0xd3515c2831559a83, 0x0d5a5b44ca873e04}, - {0x8412d9991ed58091, 0xe858790afe9486c3}, - {0xa5178fff668ae0b6, 0x626e974dbe39a873}, - {0xce5d73ff402d98e3, 0xfb0a3d212dc81290}, - {0x80fa687f881c7f8e, 0x7ce66634bc9d0b9a}, - {0xa139029f6a239f72, 0x1c1fffc1ebc44e81}, - {0xc987434744ac874e, 0xa327ffb266b56221}, - {0xfbe9141915d7a922, 0x4bf1ff9f0062baa9}, - {0x9d71ac8fada6c9b5, 0x6f773fc3603db4aa}, - {0xc4ce17b399107c22, 0xcb550fb4384d21d4}, - {0xf6019da07f549b2b, 0x7e2a53a146606a49}, - {0x99c102844f94e0fb, 0x2eda7444cbfc426e}, - {0xc0314325637a1939, 0xfa911155fefb5309}, - {0xf03d93eebc589f88, 0x793555ab7eba27cb}, - {0x96267c7535b763b5, 0x4bc1558b2f3458df}, - {0xbbb01b9283253ca2, 0x9eb1aaedfb016f17}, - {0xea9c227723ee8bcb, 0x465e15a979c1cadd}, - {0x92a1958a7675175f, 0x0bfacd89ec191eca}, - {0xb749faed14125d36, 0xcef980ec671f667c}, - {0xe51c79a85916f484, 0x82b7e12780e7401b}, - {0x8f31cc0937ae58d2, 0xd1b2ecb8b0908811}, - {0xb2fe3f0b8599ef07, 0x861fa7e6dcb4aa16}, - {0xdfbdcece67006ac9, 0x67a791e093e1d49b}, - {0x8bd6a141006042bd, 0xe0c8bb2c5c6d24e1}, - {0xaecc49914078536d, 0x58fae9f773886e19}, - {0xda7f5bf590966848, 0xaf39a475506a899f}, - {0x888f99797a5e012d, 0x6d8406c952429604}, - {0xaab37fd7d8f58178, 0xc8e5087ba6d33b84}, - {0xd5605fcdcf32e1d6, 0xfb1e4a9a90880a65}, - {0x855c3be0a17fcd26, 0x5cf2eea09a550680}, - {0xa6b34ad8c9dfc06f, 0xf42faa48c0ea481f}, - {0xd0601d8efc57b08b, 0xf13b94daf124da27}, - {0x823c12795db6ce57, 0x76c53d08d6b70859}, - {0xa2cb1717b52481ed, 0x54768c4b0c64ca6f}, - {0xcb7ddcdda26da268, 0xa9942f5dcf7dfd0a}, - {0xfe5d54150b090b02, 0xd3f93b35435d7c4d}, - {0x9efa548d26e5a6e1, 0xc47bc5014a1a6db0}, - {0xc6b8e9b0709f109a, 0x359ab6419ca1091c}, - {0xf867241c8cc6d4c0, 0xc30163d203c94b63}, - {0x9b407691d7fc44f8, 0x79e0de63425dcf1e}, - {0xc21094364dfb5636, 0x985915fc12f542e5}, - {0xf294b943e17a2bc4, 0x3e6f5b7b17b2939e}, - {0x979cf3ca6cec5b5a, 0xa705992ceecf9c43}, - {0xbd8430bd08277231, 0x50c6ff782a838354}, - {0xece53cec4a314ebd, 0xa4f8bf5635246429}, - {0x940f4613ae5ed136, 0x871b7795e136be9a}, - {0xb913179899f68584, 0x28e2557b59846e40}, - {0xe757dd7ec07426e5, 0x331aeada2fe589d0}, - {0x9096ea6f3848984f, 0x3ff0d2c85def7622}, - {0xb4bca50b065abe63, 0x0fed077a756b53aa}, - {0xe1ebce4dc7f16dfb, 0xd3e8495912c62895}, - {0x8d3360f09cf6e4bd, 0x64712dd7abbbd95d}, - {0xb080392cc4349dec, 0xbd8d794d96aacfb4}, - {0xdca04777f541c567, 0xecf0d7a0fc5583a1}, - {0x89e42caaf9491b60, 0xf41686c49db57245}, - {0xac5d37d5b79b6239, 0x311c2875c522ced6}, - {0xd77485cb25823ac7, 0x7d633293366b828c}, - {0x86a8d39ef77164bc, 0xae5dff9c02033198}, - {0xa8530886b54dbdeb, 0xd9f57f830283fdfd}, - {0xd267caa862a12d66, 0xd072df63c324fd7c}, - {0x8380dea93da4bc60, 0x4247cb9e59f71e6e}, - {0xa46116538d0deb78, 0x52d9be85f074e609}, - {0xcd795be870516656, 0x67902e276c921f8c}, - {0x806bd9714632dff6, 0x00ba1cd8a3db53b7}, - {0xa086cfcd97bf97f3, 0x80e8a40eccd228a5}, - {0xc8a883c0fdaf7df0, 0x6122cd128006b2ce}, - {0xfad2a4b13d1b5d6c, 0x796b805720085f82}, - {0x9cc3a6eec6311a63, 0xcbe3303674053bb1}, - {0xc3f490aa77bd60fc, 0xbedbfc4411068a9d}, - {0xf4f1b4d515acb93b, 0xee92fb5515482d45}, - {0x991711052d8bf3c5, 0x751bdd152d4d1c4b}, - {0xbf5cd54678eef0b6, 0xd262d45a78a0635e}, - {0xef340a98172aace4, 0x86fb897116c87c35}, - {0x9580869f0e7aac0e, 0xd45d35e6ae3d4da1}, - {0xbae0a846d2195712, 0x8974836059cca10a}, - {0xe998d258869facd7, 0x2bd1a438703fc94c}, - {0x91ff83775423cc06, 0x7b6306a34627ddd0}, - {0xb67f6455292cbf08, 0x1a3bc84c17b1d543}, - {0xe41f3d6a7377eeca, 0x20caba5f1d9e4a94}, - {0x8e938662882af53e, 0x547eb47b7282ee9d}, - {0xb23867fb2a35b28d, 0xe99e619a4f23aa44}, - {0xdec681f9f4c31f31, 0x6405fa00e2ec94d5}, - {0x8b3c113c38f9f37e, 0xde83bc408dd3dd05}, - {0xae0b158b4738705e, 0x9624ab50b148d446}, - {0xd98ddaee19068c76, 0x3badd624dd9b0958}, - {0x87f8a8d4cfa417c9, 0xe54ca5d70a80e5d7}, - {0xa9f6d30a038d1dbc, 0x5e9fcf4ccd211f4d}, - {0xd47487cc8470652b, 0x7647c32000696720}, - {0x84c8d4dfd2c63f3b, 0x29ecd9f40041e074}, - {0xa5fb0a17c777cf09, 0xf468107100525891}, - {0xcf79cc9db955c2cc, 0x7182148d4066eeb5}, - {0x81ac1fe293d599bf, 0xc6f14cd848405531}, - {0xa21727db38cb002f, 0xb8ada00e5a506a7d}, - {0xca9cf1d206fdc03b, 0xa6d90811f0e4851d}, - {0xfd442e4688bd304a, 0x908f4a166d1da664}, - {0x9e4a9cec15763e2e, 0x9a598e4e043287ff}, - {0xc5dd44271ad3cdba, 0x40eff1e1853f29fe}, - {0xf7549530e188c128, 0xd12bee59e68ef47d}, - {0x9a94dd3e8cf578b9, 0x82bb74f8301958cf}, - {0xc13a148e3032d6e7, 0xe36a52363c1faf02}, - {0xf18899b1bc3f8ca1, 0xdc44e6c3cb279ac2}, - {0x96f5600f15a7b7e5, 0x29ab103a5ef8c0ba}, - {0xbcb2b812db11a5de, 0x7415d448f6b6f0e8}, - {0xebdf661791d60f56, 0x111b495b3464ad22}, - {0x936b9fcebb25c995, 0xcab10dd900beec35}, - {0xb84687c269ef3bfb, 0x3d5d514f40eea743}, - {0xe65829b3046b0afa, 0x0cb4a5a3112a5113}, - {0x8ff71a0fe2c2e6dc, 0x47f0e785eaba72ac}, - {0xb3f4e093db73a093, 0x59ed216765690f57}, - {0xe0f218b8d25088b8, 0x306869c13ec3532d}, - {0x8c974f7383725573, 0x1e414218c73a13fc}, - {0xafbd2350644eeacf, 0xe5d1929ef90898fb}, - {0xdbac6c247d62a583, 0xdf45f746b74abf3a}, - {0x894bc396ce5da772, 0x6b8bba8c328eb784}, - {0xab9eb47c81f5114f, 0x066ea92f3f326565}, - {0xd686619ba27255a2, 0xc80a537b0efefebe}, - {0x8613fd0145877585, 0xbd06742ce95f5f37}, - {0xa798fc4196e952e7, 0x2c48113823b73705}, - {0xd17f3b51fca3a7a0, 0xf75a15862ca504c6}, - {0x82ef85133de648c4, 0x9a984d73dbe722fc}, - {0xa3ab66580d5fdaf5, 0xc13e60d0d2e0ebbb}, - {0xcc963fee10b7d1b3, 0x318df905079926a9}, - {0xffbbcfe994e5c61f, 0xfdf17746497f7053}, - {0x9fd561f1fd0f9bd3, 0xfeb6ea8bedefa634}, - {0xc7caba6e7c5382c8, 0xfe64a52ee96b8fc1}, - {0xf9bd690a1b68637b, 0x3dfdce7aa3c673b1}, - {0x9c1661a651213e2d, 0x06bea10ca65c084f}, - {0xc31bfa0fe5698db8, 0x486e494fcff30a63}, - {0xf3e2f893dec3f126, 0x5a89dba3c3efccfb}, - {0x986ddb5c6b3a76b7, 0xf89629465a75e01d}, - {0xbe89523386091465, 0xf6bbb397f1135824}, - {0xee2ba6c0678b597f, 0x746aa07ded582e2d}, - {0x94db483840b717ef, 0xa8c2a44eb4571cdd}, - {0xba121a4650e4ddeb, 0x92f34d62616ce414}, - {0xe896a0d7e51e1566, 0x77b020baf9c81d18}, - {0x915e2486ef32cd60, 0x0ace1474dc1d122f}, - {0xb5b5ada8aaff80b8, 0x0d819992132456bb}, - {0xe3231912d5bf60e6, 0x10e1fff697ed6c6a}, - {0x8df5efabc5979c8f, 0xca8d3ffa1ef463c2}, - {0xb1736b96b6fd83b3, 0xbd308ff8a6b17cb3}, - {0xddd0467c64bce4a0, 0xac7cb3f6d05ddbdf}, - {0x8aa22c0dbef60ee4, 0x6bcdf07a423aa96c}, - {0xad4ab7112eb3929d, 0x86c16c98d2c953c7}, - {0xd89d64d57a607744, 0xe871c7bf077ba8b8}, - {0x87625f056c7c4a8b, 0x11471cd764ad4973}, - {0xa93af6c6c79b5d2d, 0xd598e40d3dd89bd0}, - {0xd389b47879823479, 0x4aff1d108d4ec2c4}, - {0x843610cb4bf160cb, 0xcedf722a585139bb}, - {0xa54394fe1eedb8fe, 0xc2974eb4ee658829}, - {0xce947a3da6a9273e, 0x733d226229feea33}, - {0x811ccc668829b887, 0x0806357d5a3f5260}, - {0xa163ff802a3426a8, 0xca07c2dcb0cf26f8}, - {0xc9bcff6034c13052, 0xfc89b393dd02f0b6}, - {0xfc2c3f3841f17c67, 0xbbac2078d443ace3}, - {0x9d9ba7832936edc0, 0xd54b944b84aa4c0e}, - {0xc5029163f384a931, 0x0a9e795e65d4df12}, - {0xf64335bcf065d37d, 0x4d4617b5ff4a16d6}, - {0x99ea0196163fa42e, 0x504bced1bf8e4e46}, - {0xc06481fb9bcf8d39, 0xe45ec2862f71e1d7}, - {0xf07da27a82c37088, 0x5d767327bb4e5a4d}, - {0x964e858c91ba2655, 0x3a6a07f8d510f870}, - {0xbbe226efb628afea, 0x890489f70a55368c}, - {0xeadab0aba3b2dbe5, 0x2b45ac74ccea842f}, - {0x92c8ae6b464fc96f, 0x3b0b8bc90012929e}, - {0xb77ada0617e3bbcb, 0x09ce6ebb40173745}, - {0xe55990879ddcaabd, 0xcc420a6a101d0516}, - {0x8f57fa54c2a9eab6, 0x9fa946824a12232e}, - {0xb32df8e9f3546564, 0x47939822dc96abfa}, - {0xdff9772470297ebd, 0x59787e2b93bc56f8}, - {0x8bfbea76c619ef36, 0x57eb4edb3c55b65b}, - {0xaefae51477a06b03, 0xede622920b6b23f2}, - {0xdab99e59958885c4, 0xe95fab368e45ecee}, - {0x88b402f7fd75539b, 0x11dbcb0218ebb415}, - {0xaae103b5fcd2a881, 0xd652bdc29f26a11a}, - {0xd59944a37c0752a2, 0x4be76d3346f04960}, - {0x857fcae62d8493a5, 0x6f70a4400c562ddc}, - {0xa6dfbd9fb8e5b88e, 0xcb4ccd500f6bb953}, - {0xd097ad07a71f26b2, 0x7e2000a41346a7a8}, - {0x825ecc24c873782f, 0x8ed400668c0c28c9}, - {0xa2f67f2dfa90563b, 0x728900802f0f32fb}, - {0xcbb41ef979346bca, 0x4f2b40a03ad2ffba}, - {0xfea126b7d78186bc, 0xe2f610c84987bfa9}, - {0x9f24b832e6b0f436, 0x0dd9ca7d2df4d7ca}, - {0xc6ede63fa05d3143, 0x91503d1c79720dbc}, - {0xf8a95fcf88747d94, 0x75a44c6397ce912b}, - {0x9b69dbe1b548ce7c, 0xc986afbe3ee11abb}, - {0xc24452da229b021b, 0xfbe85badce996169}, - {0xf2d56790ab41c2a2, 0xfae27299423fb9c4}, - {0x97c560ba6b0919a5, 0xdccd879fc967d41b}, - {0xbdb6b8e905cb600f, 0x5400e987bbc1c921}, - {0xed246723473e3813, 0x290123e9aab23b69}, - {0x9436c0760c86e30b, 0xf9a0b6720aaf6522}, - {0xb94470938fa89bce, 0xf808e40e8d5b3e6a}, - {0xe7958cb87392c2c2, 0xb60b1d1230b20e05}, - {0x90bd77f3483bb9b9, 0xb1c6f22b5e6f48c3}, - {0xb4ecd5f01a4aa828, 0x1e38aeb6360b1af4}, - {0xe2280b6c20dd5232, 0x25c6da63c38de1b1}, - {0x8d590723948a535f, 0x579c487e5a38ad0f}, - {0xb0af48ec79ace837, 0x2d835a9df0c6d852}, - {0xdcdb1b2798182244, 0xf8e431456cf88e66}, - {0x8a08f0f8bf0f156b, 0x1b8e9ecb641b5900}, - {0xac8b2d36eed2dac5, 0xe272467e3d222f40}, - {0xd7adf884aa879177, 0x5b0ed81dcc6abb10}, - {0x86ccbb52ea94baea, 0x98e947129fc2b4ea}, - {0xa87fea27a539e9a5, 0x3f2398d747b36225}, - {0xd29fe4b18e88640e, 0x8eec7f0d19a03aae}, - {0x83a3eeeef9153e89, 0x1953cf68300424ad}, - {0xa48ceaaab75a8e2b, 0x5fa8c3423c052dd8}, - {0xcdb02555653131b6, 0x3792f412cb06794e}, - {0x808e17555f3ebf11, 0xe2bbd88bbee40bd1}, - {0xa0b19d2ab70e6ed6, 0x5b6aceaeae9d0ec5}, - {0xc8de047564d20a8b, 0xf245825a5a445276}, - {0xfb158592be068d2e, 0xeed6e2f0f0d56713}, - {0x9ced737bb6c4183d, 0x55464dd69685606c}, - {0xc428d05aa4751e4c, 0xaa97e14c3c26b887}, - {0xf53304714d9265df, 0xd53dd99f4b3066a9}, - {0x993fe2c6d07b7fab, 0xe546a8038efe402a}, - {0xbf8fdb78849a5f96, 0xde98520472bdd034}, - {0xef73d256a5c0f77c, 0x963e66858f6d4441}, - {0x95a8637627989aad, 0xdde7001379a44aa9}, - {0xbb127c53b17ec159, 0x5560c018580d5d53}, - {0xe9d71b689dde71af, 0xaab8f01e6e10b4a7}, - {0x9226712162ab070d, 0xcab3961304ca70e9}, - {0xb6b00d69bb55c8d1, 0x3d607b97c5fd0d23}, - {0xe45c10c42a2b3b05, 0x8cb89a7db77c506b}, - {0x8eb98a7a9a5b04e3, 0x77f3608e92adb243}, - {0xb267ed1940f1c61c, 0x55f038b237591ed4}, - {0xdf01e85f912e37a3, 0x6b6c46dec52f6689}, - {0x8b61313bbabce2c6, 0x2323ac4b3b3da016}, - {0xae397d8aa96c1b77, 0xabec975e0a0d081b}, - {0xd9c7dced53c72255, 0x96e7bd358c904a22}, - {0x881cea14545c7575, 0x7e50d64177da2e55}, - {0xaa242499697392d2, 0xdde50bd1d5d0b9ea}, - {0xd4ad2dbfc3d07787, 0x955e4ec64b44e865}, - {0x84ec3c97da624ab4, 0xbd5af13bef0b113f}, - {0xa6274bbdd0fadd61, 0xecb1ad8aeacdd58f}, - {0xcfb11ead453994ba, 0x67de18eda5814af3}, - {0x81ceb32c4b43fcf4, 0x80eacf948770ced8}, - {0xa2425ff75e14fc31, 0xa1258379a94d028e}, - {0xcad2f7f5359a3b3e, 0x096ee45813a04331}, - {0xfd87b5f28300ca0d, 0x8bca9d6e188853fd}, - {0x9e74d1b791e07e48, 0x775ea264cf55347e}, - {0xc612062576589dda, 0x95364afe032a819e}, - {0xf79687aed3eec551, 0x3a83ddbd83f52205}, - {0x9abe14cd44753b52, 0xc4926a9672793543}, - {0xc16d9a0095928a27, 0x75b7053c0f178294}, - {0xf1c90080baf72cb1, 0x5324c68b12dd6339}, - {0x971da05074da7bee, 0xd3f6fc16ebca5e04}, - {0xbce5086492111aea, 0x88f4bb1ca6bcf585}, - {0xec1e4a7db69561a5, 0x2b31e9e3d06c32e6}, - {0x9392ee8e921d5d07, 0x3aff322e62439fd0}, - {0xb877aa3236a4b449, 0x09befeb9fad487c3}, - {0xe69594bec44de15b, 0x4c2ebe687989a9b4}, - {0x901d7cf73ab0acd9, 0x0f9d37014bf60a11}, - {0xb424dc35095cd80f, 0x538484c19ef38c95}, - {0xe12e13424bb40e13, 0x2865a5f206b06fba}, - {0x8cbccc096f5088cb, 0xf93f87b7442e45d4}, - {0xafebff0bcb24aafe, 0xf78f69a51539d749}, - {0xdbe6fecebdedd5be, 0xb573440e5a884d1c}, - {0x89705f4136b4a597, 0x31680a88f8953031}, - {0xabcc77118461cefc, 0xfdc20d2b36ba7c3e}, - {0xd6bf94d5e57a42bc, 0x3d32907604691b4d}, - {0x8637bd05af6c69b5, 0xa63f9a49c2c1b110}, - {0xa7c5ac471b478423, 0x0fcf80dc33721d54}, - {0xd1b71758e219652b, 0xd3c36113404ea4a9}, - {0x83126e978d4fdf3b, 0x645a1cac083126ea}, - {0xa3d70a3d70a3d70a, 0x3d70a3d70a3d70a4}, - {0xcccccccccccccccc, 0xcccccccccccccccd}, - {0x8000000000000000, 0x0000000000000000}, - {0xa000000000000000, 0x0000000000000000}, - {0xc800000000000000, 0x0000000000000000}, - {0xfa00000000000000, 0x0000000000000000}, - {0x9c40000000000000, 0x0000000000000000}, - {0xc350000000000000, 0x0000000000000000}, - {0xf424000000000000, 0x0000000000000000}, - {0x9896800000000000, 0x0000000000000000}, - {0xbebc200000000000, 0x0000000000000000}, - {0xee6b280000000000, 0x0000000000000000}, - {0x9502f90000000000, 0x0000000000000000}, - {0xba43b74000000000, 0x0000000000000000}, - {0xe8d4a51000000000, 0x0000000000000000}, - {0x9184e72a00000000, 0x0000000000000000}, - {0xb5e620f480000000, 0x0000000000000000}, - {0xe35fa931a0000000, 0x0000000000000000}, - {0x8e1bc9bf04000000, 0x0000000000000000}, - {0xb1a2bc2ec5000000, 0x0000000000000000}, - {0xde0b6b3a76400000, 0x0000000000000000}, - {0x8ac7230489e80000, 0x0000000000000000}, - {0xad78ebc5ac620000, 0x0000000000000000}, - {0xd8d726b7177a8000, 0x0000000000000000}, - {0x878678326eac9000, 0x0000000000000000}, - {0xa968163f0a57b400, 0x0000000000000000}, - {0xd3c21bcecceda100, 0x0000000000000000}, - {0x84595161401484a0, 0x0000000000000000}, - {0xa56fa5b99019a5c8, 0x0000000000000000}, - {0xcecb8f27f4200f3a, 0x0000000000000000}, - {0x813f3978f8940984, 0x4000000000000000}, - {0xa18f07d736b90be5, 0x5000000000000000}, - {0xc9f2c9cd04674ede, 0xa400000000000000}, - {0xfc6f7c4045812296, 0x4d00000000000000}, - {0x9dc5ada82b70b59d, 0xf020000000000000}, - {0xc5371912364ce305, 0x6c28000000000000}, - {0xf684df56c3e01bc6, 0xc732000000000000}, - {0x9a130b963a6c115c, 0x3c7f400000000000}, - {0xc097ce7bc90715b3, 0x4b9f100000000000}, - {0xf0bdc21abb48db20, 0x1e86d40000000000}, - {0x96769950b50d88f4, 0x1314448000000000}, - {0xbc143fa4e250eb31, 0x17d955a000000000}, - {0xeb194f8e1ae525fd, 0x5dcfab0800000000}, - {0x92efd1b8d0cf37be, 0x5aa1cae500000000}, - {0xb7abc627050305ad, 0xf14a3d9e40000000}, - {0xe596b7b0c643c719, 0x6d9ccd05d0000000}, - {0x8f7e32ce7bea5c6f, 0xe4820023a2000000}, - {0xb35dbf821ae4f38b, 0xdda2802c8a800000}, - {0xe0352f62a19e306e, 0xd50b2037ad200000}, - {0x8c213d9da502de45, 0x4526f422cc340000}, - {0xaf298d050e4395d6, 0x9670b12b7f410000}, - {0xdaf3f04651d47b4c, 0x3c0cdd765f114000}, - {0x88d8762bf324cd0f, 0xa5880a69fb6ac800}, - {0xab0e93b6efee0053, 0x8eea0d047a457a00}, - {0xd5d238a4abe98068, 0x72a4904598d6d880}, - {0x85a36366eb71f041, 0x47a6da2b7f864750}, - {0xa70c3c40a64e6c51, 0x999090b65f67d924}, - {0xd0cf4b50cfe20765, 0xfff4b4e3f741cf6d}, - {0x82818f1281ed449f, 0xbff8f10e7a8921a5}, - {0xa321f2d7226895c7, 0xaff72d52192b6a0e}, - {0xcbea6f8ceb02bb39, 0x9bf4f8a69f764491}, - {0xfee50b7025c36a08, 0x02f236d04753d5b5}, - {0x9f4f2726179a2245, 0x01d762422c946591}, - {0xc722f0ef9d80aad6, 0x424d3ad2b7b97ef6}, - {0xf8ebad2b84e0d58b, 0xd2e0898765a7deb3}, - {0x9b934c3b330c8577, 0x63cc55f49f88eb30}, - {0xc2781f49ffcfa6d5, 0x3cbf6b71c76b25fc}, - {0xf316271c7fc3908a, 0x8bef464e3945ef7b}, - {0x97edd871cfda3a56, 0x97758bf0e3cbb5ad}, - {0xbde94e8e43d0c8ec, 0x3d52eeed1cbea318}, - {0xed63a231d4c4fb27, 0x4ca7aaa863ee4bde}, - {0x945e455f24fb1cf8, 0x8fe8caa93e74ef6b}, - {0xb975d6b6ee39e436, 0xb3e2fd538e122b45}, - {0xe7d34c64a9c85d44, 0x60dbbca87196b617}, - {0x90e40fbeea1d3a4a, 0xbc8955e946fe31ce}, - {0xb51d13aea4a488dd, 0x6babab6398bdbe42}, - {0xe264589a4dcdab14, 0xc696963c7eed2dd2}, - {0x8d7eb76070a08aec, 0xfc1e1de5cf543ca3}, - {0xb0de65388cc8ada8, 0x3b25a55f43294bcc}, - {0xdd15fe86affad912, 0x49ef0eb713f39ebf}, - {0x8a2dbf142dfcc7ab, 0x6e3569326c784338}, - {0xacb92ed9397bf996, 0x49c2c37f07965405}, - {0xd7e77a8f87daf7fb, 0xdc33745ec97be907}, - {0x86f0ac99b4e8dafd, 0x69a028bb3ded71a4}, - {0xa8acd7c0222311bc, 0xc40832ea0d68ce0d}, - {0xd2d80db02aabd62b, 0xf50a3fa490c30191}, - {0x83c7088e1aab65db, 0x792667c6da79e0fb}, - {0xa4b8cab1a1563f52, 0x577001b891185939}, - {0xcde6fd5e09abcf26, 0xed4c0226b55e6f87}, - {0x80b05e5ac60b6178, 0x544f8158315b05b5}, - {0xa0dc75f1778e39d6, 0x696361ae3db1c722}, - {0xc913936dd571c84c, 0x03bc3a19cd1e38ea}, - {0xfb5878494ace3a5f, 0x04ab48a04065c724}, - {0x9d174b2dcec0e47b, 0x62eb0d64283f9c77}, - {0xc45d1df942711d9a, 0x3ba5d0bd324f8395}, - {0xf5746577930d6500, 0xca8f44ec7ee3647a}, - {0x9968bf6abbe85f20, 0x7e998b13cf4e1ecc}, - {0xbfc2ef456ae276e8, 0x9e3fedd8c321a67f}, - {0xefb3ab16c59b14a2, 0xc5cfe94ef3ea101f}, - {0x95d04aee3b80ece5, 0xbba1f1d158724a13}, - {0xbb445da9ca61281f, 0x2a8a6e45ae8edc98}, - {0xea1575143cf97226, 0xf52d09d71a3293be}, - {0x924d692ca61be758, 0x593c2626705f9c57}, - {0xb6e0c377cfa2e12e, 0x6f8b2fb00c77836d}, - {0xe498f455c38b997a, 0x0b6dfb9c0f956448}, - {0x8edf98b59a373fec, 0x4724bd4189bd5ead}, - {0xb2977ee300c50fe7, 0x58edec91ec2cb658}, - {0xdf3d5e9bc0f653e1, 0x2f2967b66737e3ee}, - {0x8b865b215899f46c, 0xbd79e0d20082ee75}, - {0xae67f1e9aec07187, 0xecd8590680a3aa12}, - {0xda01ee641a708de9, 0xe80e6f4820cc9496}, - {0x884134fe908658b2, 0x3109058d147fdcde}, - {0xaa51823e34a7eede, 0xbd4b46f0599fd416}, - {0xd4e5e2cdc1d1ea96, 0x6c9e18ac7007c91b}, - {0x850fadc09923329e, 0x03e2cf6bc604ddb1}, - {0xa6539930bf6bff45, 0x84db8346b786151d}, - {0xcfe87f7cef46ff16, 0xe612641865679a64}, - {0x81f14fae158c5f6e, 0x4fcb7e8f3f60c07f}, - {0xa26da3999aef7749, 0xe3be5e330f38f09e}, - {0xcb090c8001ab551c, 0x5cadf5bfd3072cc6}, - {0xfdcb4fa002162a63, 0x73d9732fc7c8f7f7}, - {0x9e9f11c4014dda7e, 0x2867e7fddcdd9afb}, - {0xc646d63501a1511d, 0xb281e1fd541501b9}, - {0xf7d88bc24209a565, 0x1f225a7ca91a4227}, - {0x9ae757596946075f, 0x3375788de9b06959}, - {0xc1a12d2fc3978937, 0x0052d6b1641c83af}, - {0xf209787bb47d6b84, 0xc0678c5dbd23a49b}, - {0x9745eb4d50ce6332, 0xf840b7ba963646e1}, - {0xbd176620a501fbff, 0xb650e5a93bc3d899}, - {0xec5d3fa8ce427aff, 0xa3e51f138ab4cebf}, - {0x93ba47c980e98cdf, 0xc66f336c36b10138}, - {0xb8a8d9bbe123f017, 0xb80b0047445d4185}, - {0xe6d3102ad96cec1d, 0xa60dc059157491e6}, - {0x9043ea1ac7e41392, 0x87c89837ad68db30}, - {0xb454e4a179dd1877, 0x29babe4598c311fc}, - {0xe16a1dc9d8545e94, 0xf4296dd6fef3d67b}, - {0x8ce2529e2734bb1d, 0x1899e4a65f58660d}, - {0xb01ae745b101e9e4, 0x5ec05dcff72e7f90}, - {0xdc21a1171d42645d, 0x76707543f4fa1f74}, - {0x899504ae72497eba, 0x6a06494a791c53a9}, - {0xabfa45da0edbde69, 0x0487db9d17636893}, - {0xd6f8d7509292d603, 0x45a9d2845d3c42b7}, - {0x865b86925b9bc5c2, 0x0b8a2392ba45a9b3}, - {0xa7f26836f282b732, 0x8e6cac7768d7141f}, - {0xd1ef0244af2364ff, 0x3207d795430cd927}, - {0x8335616aed761f1f, 0x7f44e6bd49e807b9}, - {0xa402b9c5a8d3a6e7, 0x5f16206c9c6209a7}, - {0xcd036837130890a1, 0x36dba887c37a8c10}, - {0x802221226be55a64, 0xc2494954da2c978a}, - {0xa02aa96b06deb0fd, 0xf2db9baa10b7bd6d}, - {0xc83553c5c8965d3d, 0x6f92829494e5acc8}, - {0xfa42a8b73abbf48c, 0xcb772339ba1f17fa}, - {0x9c69a97284b578d7, 0xff2a760414536efc}, - {0xc38413cf25e2d70d, 0xfef5138519684abb}, - {0xf46518c2ef5b8cd1, 0x7eb258665fc25d6a}, - {0x98bf2f79d5993802, 0xef2f773ffbd97a62}, - {0xbeeefb584aff8603, 0xaafb550ffacfd8fb}, - {0xeeaaba2e5dbf6784, 0x95ba2a53f983cf39}, - {0x952ab45cfa97a0b2, 0xdd945a747bf26184}, - {0xba756174393d88df, 0x94f971119aeef9e5}, - {0xe912b9d1478ceb17, 0x7a37cd5601aab85e}, - {0x91abb422ccb812ee, 0xac62e055c10ab33b}, - {0xb616a12b7fe617aa, 0x577b986b314d600a}, - {0xe39c49765fdf9d94, 0xed5a7e85fda0b80c}, - {0x8e41ade9fbebc27d, 0x14588f13be847308}, - {0xb1d219647ae6b31c, 0x596eb2d8ae258fc9}, - {0xde469fbd99a05fe3, 0x6fca5f8ed9aef3bc}, - {0x8aec23d680043bee, 0x25de7bb9480d5855}, - {0xada72ccc20054ae9, 0xaf561aa79a10ae6b}, - {0xd910f7ff28069da4, 0x1b2ba1518094da05}, - {0x87aa9aff79042286, 0x90fb44d2f05d0843}, - {0xa99541bf57452b28, 0x353a1607ac744a54}, - {0xd3fa922f2d1675f2, 0x42889b8997915ce9}, - {0x847c9b5d7c2e09b7, 0x69956135febada12}, - {0xa59bc234db398c25, 0x43fab9837e699096}, - {0xcf02b2c21207ef2e, 0x94f967e45e03f4bc}, - {0x8161afb94b44f57d, 0x1d1be0eebac278f6}, - {0xa1ba1ba79e1632dc, 0x6462d92a69731733}, - {0xca28a291859bbf93, 0x7d7b8f7503cfdcff}, - {0xfcb2cb35e702af78, 0x5cda735244c3d43f}, - {0x9defbf01b061adab, 0x3a0888136afa64a8}, - {0xc56baec21c7a1916, 0x088aaa1845b8fdd1}, - {0xf6c69a72a3989f5b, 0x8aad549e57273d46}, - {0x9a3c2087a63f6399, 0x36ac54e2f678864c}, - {0xc0cb28a98fcf3c7f, 0x84576a1bb416a7de}, - {0xf0fdf2d3f3c30b9f, 0x656d44a2a11c51d6}, - {0x969eb7c47859e743, 0x9f644ae5a4b1b326}, - {0xbc4665b596706114, 0x873d5d9f0dde1fef}, - {0xeb57ff22fc0c7959, 0xa90cb506d155a7eb}, - {0x9316ff75dd87cbd8, 0x09a7f12442d588f3}, - {0xb7dcbf5354e9bece, 0x0c11ed6d538aeb30}, - {0xe5d3ef282a242e81, 0x8f1668c8a86da5fb}, - {0x8fa475791a569d10, 0xf96e017d694487bd}, - {0xb38d92d760ec4455, 0x37c981dcc395a9ad}, - {0xe070f78d3927556a, 0x85bbe253f47b1418}, - {0x8c469ab843b89562, 0x93956d7478ccec8f}, - {0xaf58416654a6babb, 0x387ac8d1970027b3}, - {0xdb2e51bfe9d0696a, 0x06997b05fcc0319f}, - {0x88fcf317f22241e2, 0x441fece3bdf81f04}, - {0xab3c2fddeeaad25a, 0xd527e81cad7626c4}, - {0xd60b3bd56a5586f1, 0x8a71e223d8d3b075}, - {0x85c7056562757456, 0xf6872d5667844e4a}, - {0xa738c6bebb12d16c, 0xb428f8ac016561dc}, - {0xd106f86e69d785c7, 0xe13336d701beba53}, - {0x82a45b450226b39c, 0xecc0024661173474}, - {0xa34d721642b06084, 0x27f002d7f95d0191}, - {0xcc20ce9bd35c78a5, 0x31ec038df7b441f5}, - {0xff290242c83396ce, 0x7e67047175a15272}, - {0x9f79a169bd203e41, 0x0f0062c6e984d387}, - {0xc75809c42c684dd1, 0x52c07b78a3e60869}, - {0xf92e0c3537826145, 0xa7709a56ccdf8a83}, - {0x9bbcc7a142b17ccb, 0x88a66076400bb692}, - {0xc2abf989935ddbfe, 0x6acff893d00ea436}, - {0xf356f7ebf83552fe, 0x0583f6b8c4124d44}, - {0x98165af37b2153de, 0xc3727a337a8b704b}, - {0xbe1bf1b059e9a8d6, 0x744f18c0592e4c5d}, - {0xeda2ee1c7064130c, 0x1162def06f79df74}, - {0x9485d4d1c63e8be7, 0x8addcb5645ac2ba9}, - {0xb9a74a0637ce2ee1, 0x6d953e2bd7173693}, - {0xe8111c87c5c1ba99, 0xc8fa8db6ccdd0438}, - {0x910ab1d4db9914a0, 0x1d9c9892400a22a3}, - {0xb54d5e4a127f59c8, 0x2503beb6d00cab4c}, - {0xe2a0b5dc971f303a, 0x2e44ae64840fd61e}, - {0x8da471a9de737e24, 0x5ceaecfed289e5d3}, - {0xb10d8e1456105dad, 0x7425a83e872c5f48}, - {0xdd50f1996b947518, 0xd12f124e28f7771a}, - {0x8a5296ffe33cc92f, 0x82bd6b70d99aaa70}, - {0xace73cbfdc0bfb7b, 0x636cc64d1001550c}, - {0xd8210befd30efa5a, 0x3c47f7e05401aa4f}, - {0x8714a775e3e95c78, 0x65acfaec34810a72}, - {0xa8d9d1535ce3b396, 0x7f1839a741a14d0e}, - {0xd31045a8341ca07c, 0x1ede48111209a051}, - {0x83ea2b892091e44d, 0x934aed0aab460433}, - {0xa4e4b66b68b65d60, 0xf81da84d56178540}, - {0xce1de40642e3f4b9, 0x36251260ab9d668f}, - {0x80d2ae83e9ce78f3, 0xc1d72b7c6b42601a}, - {0xa1075a24e4421730, 0xb24cf65b8612f820}, - {0xc94930ae1d529cfc, 0xdee033f26797b628}, - {0xfb9b7cd9a4a7443c, 0x169840ef017da3b2}, - {0x9d412e0806e88aa5, 0x8e1f289560ee864f}, - {0xc491798a08a2ad4e, 0xf1a6f2bab92a27e3}, - {0xf5b5d7ec8acb58a2, 0xae10af696774b1dc}, - {0x9991a6f3d6bf1765, 0xacca6da1e0a8ef2a}, - {0xbff610b0cc6edd3f, 0x17fd090a58d32af4}, - {0xeff394dcff8a948e, 0xddfc4b4cef07f5b1}, - {0x95f83d0a1fb69cd9, 0x4abdaf101564f98f}, - {0xbb764c4ca7a4440f, 0x9d6d1ad41abe37f2}, - {0xea53df5fd18d5513, 0x84c86189216dc5ee}, - {0x92746b9be2f8552c, 0x32fd3cf5b4e49bb5}, - {0xb7118682dbb66a77, 0x3fbc8c33221dc2a2}, - {0xe4d5e82392a40515, 0x0fabaf3feaa5334b}, - {0x8f05b1163ba6832d, 0x29cb4d87f2a7400f}, - {0xb2c71d5bca9023f8, 0x743e20e9ef511013}, - {0xdf78e4b2bd342cf6, 0x914da9246b255417}, - {0x8bab8eefb6409c1a, 0x1ad089b6c2f7548f}, - {0xae9672aba3d0c320, 0xa184ac2473b529b2}, - {0xda3c0f568cc4f3e8, 0xc9e5d72d90a2741f}, - {0x8865899617fb1871, 0x7e2fa67c7a658893}, - {0xaa7eebfb9df9de8d, 0xddbb901b98feeab8}, - {0xd51ea6fa85785631, 0x552a74227f3ea566}, - {0x8533285c936b35de, 0xd53a88958f872760}, - {0xa67ff273b8460356, 0x8a892abaf368f138}, - {0xd01fef10a657842c, 0x2d2b7569b0432d86}, - {0x8213f56a67f6b29b, 0x9c3b29620e29fc74}, - {0xa298f2c501f45f42, 0x8349f3ba91b47b90}, - {0xcb3f2f7642717713, 0x241c70a936219a74}, - {0xfe0efb53d30dd4d7, 0xed238cd383aa0111}, - {0x9ec95d1463e8a506, 0xf4363804324a40ab}, - {0xc67bb4597ce2ce48, 0xb143c6053edcd0d6}, - {0xf81aa16fdc1b81da, 0xdd94b7868e94050b}, - {0x9b10a4e5e9913128, 0xca7cf2b4191c8327}, - {0xc1d4ce1f63f57d72, 0xfd1c2f611f63a3f1}, - {0xf24a01a73cf2dccf, 0xbc633b39673c8ced}, - {0x976e41088617ca01, 0xd5be0503e085d814}, - {0xbd49d14aa79dbc82, 0x4b2d8644d8a74e19}, - {0xec9c459d51852ba2, 0xddf8e7d60ed1219f}, - {0x93e1ab8252f33b45, 0xcabb90e5c942b504}, - {0xb8da1662e7b00a17, 0x3d6a751f3b936244}, - {0xe7109bfba19c0c9d, 0x0cc512670a783ad5}, - {0x906a617d450187e2, 0x27fb2b80668b24c6}, - {0xb484f9dc9641e9da, 0xb1f9f660802dedf7}, - {0xe1a63853bbd26451, 0x5e7873f8a0396974}, - {0x8d07e33455637eb2, 0xdb0b487b6423e1e9}, - {0xb049dc016abc5e5f, 0x91ce1a9a3d2cda63}, - {0xdc5c5301c56b75f7, 0x7641a140cc7810fc}, - {0x89b9b3e11b6329ba, 0xa9e904c87fcb0a9e}, - {0xac2820d9623bf429, 0x546345fa9fbdcd45}, - {0xd732290fbacaf133, 0xa97c177947ad4096}, - {0x867f59a9d4bed6c0, 0x49ed8eabcccc485e}, - {0xa81f301449ee8c70, 0x5c68f256bfff5a75}, - {0xd226fc195c6a2f8c, 0x73832eec6fff3112}, - {0x83585d8fd9c25db7, 0xc831fd53c5ff7eac}, - {0xa42e74f3d032f525, 0xba3e7ca8b77f5e56}, - {0xcd3a1230c43fb26f, 0x28ce1bd2e55f35ec}, - {0x80444b5e7aa7cf85, 0x7980d163cf5b81b4}, - {0xa0555e361951c366, 0xd7e105bcc3326220}, - {0xc86ab5c39fa63440, 0x8dd9472bf3fefaa8}, - {0xfa856334878fc150, 0xb14f98f6f0feb952}, - {0x9c935e00d4b9d8d2, 0x6ed1bf9a569f33d4}, - {0xc3b8358109e84f07, 0x0a862f80ec4700c9}, - {0xf4a642e14c6262c8, 0xcd27bb612758c0fb}, - {0x98e7e9cccfbd7dbd, 0x8038d51cb897789d}, - {0xbf21e44003acdd2c, 0xe0470a63e6bd56c4}, - {0xeeea5d5004981478, 0x1858ccfce06cac75}, - {0x95527a5202df0ccb, 0x0f37801e0c43ebc9}, - {0xbaa718e68396cffd, 0xd30560258f54e6bb}, - {0xe950df20247c83fd, 0x47c6b82ef32a206a}, - {0x91d28b7416cdd27e, 0x4cdc331d57fa5442}, - {0xb6472e511c81471d, 0xe0133fe4adf8e953}, - {0xe3d8f9e563a198e5, 0x58180fddd97723a7}, - {0x8e679c2f5e44ff8f, 0x570f09eaa7ea7649}, - {0xb201833b35d63f73, 0x2cd2cc6551e513db}, - {0xde81e40a034bcf4f, 0xf8077f7ea65e58d2}, - {0x8b112e86420f6191, 0xfb04afaf27faf783}, - {0xadd57a27d29339f6, 0x79c5db9af1f9b564}, - {0xd94ad8b1c7380874, 0x18375281ae7822bd}, - {0x87cec76f1c830548, 0x8f2293910d0b15b6}, - {0xa9c2794ae3a3c69a, 0xb2eb3875504ddb23}, - {0xd433179d9c8cb841, 0x5fa60692a46151ec}, - {0x849feec281d7f328, 0xdbc7c41ba6bcd334}, - {0xa5c7ea73224deff3, 0x12b9b522906c0801}, - {0xcf39e50feae16bef, 0xd768226b34870a01}, - {0x81842f29f2cce375, 0xe6a1158300d46641}, - {0xa1e53af46f801c53, 0x60495ae3c1097fd1}, - {0xca5e89b18b602368, 0x385bb19cb14bdfc5}, - {0xfcf62c1dee382c42, 0x46729e03dd9ed7b6}, - {0x9e19db92b4e31ba9, 0x6c07a2c26a8346d2}, - {0xc5a05277621be293, 0xc7098b7305241886}, - {0xf70867153aa2db38, 0xb8cbee4fc66d1ea8}, - {0x9a65406d44a5c903, 0x737f74f1dc043329}, - {0xc0fe908895cf3b44, 0x505f522e53053ff3}, - {0xf13e34aabb430a15, 0x647726b9e7c68ff0}, - {0x96c6e0eab509e64d, 0x5eca783430dc19f6}, - {0xbc789925624c5fe0, 0xb67d16413d132073}, - {0xeb96bf6ebadf77d8, 0xe41c5bd18c57e890}, - {0x933e37a534cbaae7, 0x8e91b962f7b6f15a}, - {0xb80dc58e81fe95a1, 0x723627bbb5a4adb1}, - {0xe61136f2227e3b09, 0xcec3b1aaa30dd91d}, - {0x8fcac257558ee4e6, 0x213a4f0aa5e8a7b2}, - {0xb3bd72ed2af29e1f, 0xa988e2cd4f62d19e}, - {0xe0accfa875af45a7, 0x93eb1b80a33b8606}, - {0x8c6c01c9498d8b88, 0xbc72f130660533c4}, - {0xaf87023b9bf0ee6a, 0xeb8fad7c7f8680b5}, - {0xdb68c2ca82ed2a05, 0xa67398db9f6820e2}, + {0xff77b1fcbebcdc4f, 0x25e8e89c13bb0f7b}, + {0x9faacf3df73609b1, 0x77b191618c54e9ad}, + {0xc795830d75038c1d, 0xd59df5b9ef6a2418}, + {0xf97ae3d0d2446f25, 0x4b0573286b44ad1e}, + {0x9becce62836ac577, 0x4ee367f9430aec33}, + {0xc2e801fb244576d5, 0x229c41f793cda740}, + {0xf3a20279ed56d48a, 0x6b43527578c11110}, + {0x9845418c345644d6, 0x830a13896b78aaaa}, + {0xbe5691ef416bd60c, 0x23cc986bc656d554}, + {0xedec366b11c6cb8f, 0x2cbfbe86b7ec8aa9}, + {0x94b3a202eb1c3f39, 0x7bf7d71432f3d6aa}, + {0xb9e08a83a5e34f07, 0xdaf5ccd93fb0cc54}, + {0xe858ad248f5c22c9, 0xd1b3400f8f9cff69}, + {0x91376c36d99995be, 0x23100809b9c21fa2}, + {0xb58547448ffffb2d, 0xabd40a0c2832a78b}, + {0xe2e69915b3fff9f9, 0x16c90c8f323f516d}, + {0x8dd01fad907ffc3b, 0xae3da7d97f6792e4}, + {0xb1442798f49ffb4a, 0x99cd11cfdf41779d}, + {0xdd95317f31c7fa1d, 0x40405643d711d584}, + {0x8a7d3eef7f1cfc52, 0x482835ea666b2573}, + {0xad1c8eab5ee43b66, 0xda3243650005eed0}, + {0xd863b256369d4a40, 0x90bed43e40076a83}, + {0x873e4f75e2224e68, 0x5a7744a6e804a292}, + {0xa90de3535aaae202, 0x711515d0a205cb37}, + {0xd3515c2831559a83, 0x0d5a5b44ca873e04}, + {0x8412d9991ed58091, 0xe858790afe9486c3}, + {0xa5178fff668ae0b6, 0x626e974dbe39a873}, + {0xce5d73ff402d98e3, 0xfb0a3d212dc81290}, + {0x80fa687f881c7f8e, 0x7ce66634bc9d0b9a}, + {0xa139029f6a239f72, 0x1c1fffc1ebc44e81}, + {0xc987434744ac874e, 0xa327ffb266b56221}, + {0xfbe9141915d7a922, 0x4bf1ff9f0062baa9}, + {0x9d71ac8fada6c9b5, 0x6f773fc3603db4aa}, + {0xc4ce17b399107c22, 0xcb550fb4384d21d4}, + {0xf6019da07f549b2b, 0x7e2a53a146606a49}, + {0x99c102844f94e0fb, 0x2eda7444cbfc426e}, + {0xc0314325637a1939, 0xfa911155fefb5309}, + {0xf03d93eebc589f88, 0x793555ab7eba27cb}, + {0x96267c7535b763b5, 0x4bc1558b2f3458df}, + {0xbbb01b9283253ca2, 0x9eb1aaedfb016f17}, + {0xea9c227723ee8bcb, 0x465e15a979c1cadd}, + {0x92a1958a7675175f, 0x0bfacd89ec191eca}, + {0xb749faed14125d36, 0xcef980ec671f667c}, + {0xe51c79a85916f484, 0x82b7e12780e7401b}, + {0x8f31cc0937ae58d2, 0xd1b2ecb8b0908811}, + {0xb2fe3f0b8599ef07, 0x861fa7e6dcb4aa16}, + {0xdfbdcece67006ac9, 0x67a791e093e1d49b}, + {0x8bd6a141006042bd, 0xe0c8bb2c5c6d24e1}, + {0xaecc49914078536d, 0x58fae9f773886e19}, + {0xda7f5bf590966848, 0xaf39a475506a899f}, + {0x888f99797a5e012d, 0x6d8406c952429604}, + {0xaab37fd7d8f58178, 0xc8e5087ba6d33b84}, + {0xd5605fcdcf32e1d6, 0xfb1e4a9a90880a65}, + {0x855c3be0a17fcd26, 0x5cf2eea09a550680}, + {0xa6b34ad8c9dfc06f, 0xf42faa48c0ea481f}, + {0xd0601d8efc57b08b, 0xf13b94daf124da27}, + {0x823c12795db6ce57, 0x76c53d08d6b70859}, + {0xa2cb1717b52481ed, 0x54768c4b0c64ca6f}, + {0xcb7ddcdda26da268, 0xa9942f5dcf7dfd0a}, + {0xfe5d54150b090b02, 0xd3f93b35435d7c4d}, + {0x9efa548d26e5a6e1, 0xc47bc5014a1a6db0}, + {0xc6b8e9b0709f109a, 0x359ab6419ca1091c}, + {0xf867241c8cc6d4c0, 0xc30163d203c94b63}, + {0x9b407691d7fc44f8, 0x79e0de63425dcf1e}, + {0xc21094364dfb5636, 0x985915fc12f542e5}, + {0xf294b943e17a2bc4, 0x3e6f5b7b17b2939e}, + {0x979cf3ca6cec5b5a, 0xa705992ceecf9c43}, + {0xbd8430bd08277231, 0x50c6ff782a838354}, + {0xece53cec4a314ebd, 0xa4f8bf5635246429}, + {0x940f4613ae5ed136, 0x871b7795e136be9a}, + {0xb913179899f68584, 0x28e2557b59846e40}, + {0xe757dd7ec07426e5, 0x331aeada2fe589d0}, + {0x9096ea6f3848984f, 0x3ff0d2c85def7622}, + {0xb4bca50b065abe63, 0x0fed077a756b53aa}, + {0xe1ebce4dc7f16dfb, 0xd3e8495912c62895}, + {0x8d3360f09cf6e4bd, 0x64712dd7abbbd95d}, + {0xb080392cc4349dec, 0xbd8d794d96aacfb4}, + {0xdca04777f541c567, 0xecf0d7a0fc5583a1}, + {0x89e42caaf9491b60, 0xf41686c49db57245}, + {0xac5d37d5b79b6239, 0x311c2875c522ced6}, + {0xd77485cb25823ac7, 0x7d633293366b828c}, + {0x86a8d39ef77164bc, 0xae5dff9c02033198}, + {0xa8530886b54dbdeb, 0xd9f57f830283fdfd}, + {0xd267caa862a12d66, 0xd072df63c324fd7c}, + {0x8380dea93da4bc60, 0x4247cb9e59f71e6e}, + {0xa46116538d0deb78, 0x52d9be85f074e609}, + {0xcd795be870516656, 0x67902e276c921f8c}, + {0x806bd9714632dff6, 0x00ba1cd8a3db53b7}, + {0xa086cfcd97bf97f3, 0x80e8a40eccd228a5}, + {0xc8a883c0fdaf7df0, 0x6122cd128006b2ce}, + {0xfad2a4b13d1b5d6c, 0x796b805720085f82}, + {0x9cc3a6eec6311a63, 0xcbe3303674053bb1}, + {0xc3f490aa77bd60fc, 0xbedbfc4411068a9d}, + {0xf4f1b4d515acb93b, 0xee92fb5515482d45}, + {0x991711052d8bf3c5, 0x751bdd152d4d1c4b}, + {0xbf5cd54678eef0b6, 0xd262d45a78a0635e}, + {0xef340a98172aace4, 0x86fb897116c87c35}, + {0x9580869f0e7aac0e, 0xd45d35e6ae3d4da1}, + {0xbae0a846d2195712, 0x8974836059cca10a}, + {0xe998d258869facd7, 0x2bd1a438703fc94c}, + {0x91ff83775423cc06, 0x7b6306a34627ddd0}, + {0xb67f6455292cbf08, 0x1a3bc84c17b1d543}, + {0xe41f3d6a7377eeca, 0x20caba5f1d9e4a94}, + {0x8e938662882af53e, 0x547eb47b7282ee9d}, + {0xb23867fb2a35b28d, 0xe99e619a4f23aa44}, + {0xdec681f9f4c31f31, 0x6405fa00e2ec94d5}, + {0x8b3c113c38f9f37e, 0xde83bc408dd3dd05}, + {0xae0b158b4738705e, 0x9624ab50b148d446}, + {0xd98ddaee19068c76, 0x3badd624dd9b0958}, + {0x87f8a8d4cfa417c9, 0xe54ca5d70a80e5d7}, + {0xa9f6d30a038d1dbc, 0x5e9fcf4ccd211f4d}, + {0xd47487cc8470652b, 0x7647c32000696720}, + {0x84c8d4dfd2c63f3b, 0x29ecd9f40041e074}, + {0xa5fb0a17c777cf09, 0xf468107100525891}, + {0xcf79cc9db955c2cc, 0x7182148d4066eeb5}, + {0x81ac1fe293d599bf, 0xc6f14cd848405531}, + {0xa21727db38cb002f, 0xb8ada00e5a506a7d}, + {0xca9cf1d206fdc03b, 0xa6d90811f0e4851d}, + {0xfd442e4688bd304a, 0x908f4a166d1da664}, + {0x9e4a9cec15763e2e, 0x9a598e4e043287ff}, + {0xc5dd44271ad3cdba, 0x40eff1e1853f29fe}, + {0xf7549530e188c128, 0xd12bee59e68ef47d}, + {0x9a94dd3e8cf578b9, 0x82bb74f8301958cf}, + {0xc13a148e3032d6e7, 0xe36a52363c1faf02}, + {0xf18899b1bc3f8ca1, 0xdc44e6c3cb279ac2}, + {0x96f5600f15a7b7e5, 0x29ab103a5ef8c0ba}, + {0xbcb2b812db11a5de, 0x7415d448f6b6f0e8}, + {0xebdf661791d60f56, 0x111b495b3464ad22}, + {0x936b9fcebb25c995, 0xcab10dd900beec35}, + {0xb84687c269ef3bfb, 0x3d5d514f40eea743}, + {0xe65829b3046b0afa, 0x0cb4a5a3112a5113}, + {0x8ff71a0fe2c2e6dc, 0x47f0e785eaba72ac}, + {0xb3f4e093db73a093, 0x59ed216765690f57}, + {0xe0f218b8d25088b8, 0x306869c13ec3532d}, + {0x8c974f7383725573, 0x1e414218c73a13fc}, + {0xafbd2350644eeacf, 0xe5d1929ef90898fb}, + {0xdbac6c247d62a583, 0xdf45f746b74abf3a}, + {0x894bc396ce5da772, 0x6b8bba8c328eb784}, + {0xab9eb47c81f5114f, 0x066ea92f3f326565}, + {0xd686619ba27255a2, 0xc80a537b0efefebe}, + {0x8613fd0145877585, 0xbd06742ce95f5f37}, + {0xa798fc4196e952e7, 0x2c48113823b73705}, + {0xd17f3b51fca3a7a0, 0xf75a15862ca504c6}, + {0x82ef85133de648c4, 0x9a984d73dbe722fc}, + {0xa3ab66580d5fdaf5, 0xc13e60d0d2e0ebbb}, + {0xcc963fee10b7d1b3, 0x318df905079926a9}, + {0xffbbcfe994e5c61f, 0xfdf17746497f7053}, + {0x9fd561f1fd0f9bd3, 0xfeb6ea8bedefa634}, + {0xc7caba6e7c5382c8, 0xfe64a52ee96b8fc1}, + {0xf9bd690a1b68637b, 0x3dfdce7aa3c673b1}, + {0x9c1661a651213e2d, 0x06bea10ca65c084f}, + {0xc31bfa0fe5698db8, 0x486e494fcff30a63}, + {0xf3e2f893dec3f126, 0x5a89dba3c3efccfb}, + {0x986ddb5c6b3a76b7, 0xf89629465a75e01d}, + {0xbe89523386091465, 0xf6bbb397f1135824}, + {0xee2ba6c0678b597f, 0x746aa07ded582e2d}, + {0x94db483840b717ef, 0xa8c2a44eb4571cdd}, + {0xba121a4650e4ddeb, 0x92f34d62616ce414}, + {0xe896a0d7e51e1566, 0x77b020baf9c81d18}, + {0x915e2486ef32cd60, 0x0ace1474dc1d122f}, + {0xb5b5ada8aaff80b8, 0x0d819992132456bb}, + {0xe3231912d5bf60e6, 0x10e1fff697ed6c6a}, + {0x8df5efabc5979c8f, 0xca8d3ffa1ef463c2}, + {0xb1736b96b6fd83b3, 0xbd308ff8a6b17cb3}, + {0xddd0467c64bce4a0, 0xac7cb3f6d05ddbdf}, + {0x8aa22c0dbef60ee4, 0x6bcdf07a423aa96c}, + {0xad4ab7112eb3929d, 0x86c16c98d2c953c7}, + {0xd89d64d57a607744, 0xe871c7bf077ba8b8}, + {0x87625f056c7c4a8b, 0x11471cd764ad4973}, + {0xa93af6c6c79b5d2d, 0xd598e40d3dd89bd0}, + {0xd389b47879823479, 0x4aff1d108d4ec2c4}, + {0x843610cb4bf160cb, 0xcedf722a585139bb}, + {0xa54394fe1eedb8fe, 0xc2974eb4ee658829}, + {0xce947a3da6a9273e, 0x733d226229feea33}, + {0x811ccc668829b887, 0x0806357d5a3f5260}, + {0xa163ff802a3426a8, 0xca07c2dcb0cf26f8}, + {0xc9bcff6034c13052, 0xfc89b393dd02f0b6}, + {0xfc2c3f3841f17c67, 0xbbac2078d443ace3}, + {0x9d9ba7832936edc0, 0xd54b944b84aa4c0e}, + {0xc5029163f384a931, 0x0a9e795e65d4df12}, + {0xf64335bcf065d37d, 0x4d4617b5ff4a16d6}, + {0x99ea0196163fa42e, 0x504bced1bf8e4e46}, + {0xc06481fb9bcf8d39, 0xe45ec2862f71e1d7}, + {0xf07da27a82c37088, 0x5d767327bb4e5a4d}, + {0x964e858c91ba2655, 0x3a6a07f8d510f870}, + {0xbbe226efb628afea, 0x890489f70a55368c}, + {0xeadab0aba3b2dbe5, 0x2b45ac74ccea842f}, + {0x92c8ae6b464fc96f, 0x3b0b8bc90012929e}, + {0xb77ada0617e3bbcb, 0x09ce6ebb40173745}, + {0xe55990879ddcaabd, 0xcc420a6a101d0516}, + {0x8f57fa54c2a9eab6, 0x9fa946824a12232e}, + {0xb32df8e9f3546564, 0x47939822dc96abfa}, + {0xdff9772470297ebd, 0x59787e2b93bc56f8}, + {0x8bfbea76c619ef36, 0x57eb4edb3c55b65b}, + {0xaefae51477a06b03, 0xede622920b6b23f2}, + {0xdab99e59958885c4, 0xe95fab368e45ecee}, + {0x88b402f7fd75539b, 0x11dbcb0218ebb415}, + {0xaae103b5fcd2a881, 0xd652bdc29f26a11a}, + {0xd59944a37c0752a2, 0x4be76d3346f04960}, + {0x857fcae62d8493a5, 0x6f70a4400c562ddc}, + {0xa6dfbd9fb8e5b88e, 0xcb4ccd500f6bb953}, + {0xd097ad07a71f26b2, 0x7e2000a41346a7a8}, + {0x825ecc24c873782f, 0x8ed400668c0c28c9}, + {0xa2f67f2dfa90563b, 0x728900802f0f32fb}, + {0xcbb41ef979346bca, 0x4f2b40a03ad2ffba}, + {0xfea126b7d78186bc, 0xe2f610c84987bfa9}, + {0x9f24b832e6b0f436, 0x0dd9ca7d2df4d7ca}, + {0xc6ede63fa05d3143, 0x91503d1c79720dbc}, + {0xf8a95fcf88747d94, 0x75a44c6397ce912b}, + {0x9b69dbe1b548ce7c, 0xc986afbe3ee11abb}, + {0xc24452da229b021b, 0xfbe85badce996169}, + {0xf2d56790ab41c2a2, 0xfae27299423fb9c4}, + {0x97c560ba6b0919a5, 0xdccd879fc967d41b}, + {0xbdb6b8e905cb600f, 0x5400e987bbc1c921}, + {0xed246723473e3813, 0x290123e9aab23b69}, + {0x9436c0760c86e30b, 0xf9a0b6720aaf6522}, + {0xb94470938fa89bce, 0xf808e40e8d5b3e6a}, + {0xe7958cb87392c2c2, 0xb60b1d1230b20e05}, + {0x90bd77f3483bb9b9, 0xb1c6f22b5e6f48c3}, + {0xb4ecd5f01a4aa828, 0x1e38aeb6360b1af4}, + {0xe2280b6c20dd5232, 0x25c6da63c38de1b1}, + {0x8d590723948a535f, 0x579c487e5a38ad0f}, + {0xb0af48ec79ace837, 0x2d835a9df0c6d852}, + {0xdcdb1b2798182244, 0xf8e431456cf88e66}, + {0x8a08f0f8bf0f156b, 0x1b8e9ecb641b5900}, + {0xac8b2d36eed2dac5, 0xe272467e3d222f40}, + {0xd7adf884aa879177, 0x5b0ed81dcc6abb10}, + {0x86ccbb52ea94baea, 0x98e947129fc2b4ea}, + {0xa87fea27a539e9a5, 0x3f2398d747b36225}, + {0xd29fe4b18e88640e, 0x8eec7f0d19a03aae}, + {0x83a3eeeef9153e89, 0x1953cf68300424ad}, + {0xa48ceaaab75a8e2b, 0x5fa8c3423c052dd8}, + {0xcdb02555653131b6, 0x3792f412cb06794e}, + {0x808e17555f3ebf11, 0xe2bbd88bbee40bd1}, + {0xa0b19d2ab70e6ed6, 0x5b6aceaeae9d0ec5}, + {0xc8de047564d20a8b, 0xf245825a5a445276}, + {0xfb158592be068d2e, 0xeed6e2f0f0d56713}, + {0x9ced737bb6c4183d, 0x55464dd69685606c}, + {0xc428d05aa4751e4c, 0xaa97e14c3c26b887}, + {0xf53304714d9265df, 0xd53dd99f4b3066a9}, + {0x993fe2c6d07b7fab, 0xe546a8038efe402a}, + {0xbf8fdb78849a5f96, 0xde98520472bdd034}, + {0xef73d256a5c0f77c, 0x963e66858f6d4441}, + {0x95a8637627989aad, 0xdde7001379a44aa9}, + {0xbb127c53b17ec159, 0x5560c018580d5d53}, + {0xe9d71b689dde71af, 0xaab8f01e6e10b4a7}, + {0x9226712162ab070d, 0xcab3961304ca70e9}, + {0xb6b00d69bb55c8d1, 0x3d607b97c5fd0d23}, + {0xe45c10c42a2b3b05, 0x8cb89a7db77c506b}, + {0x8eb98a7a9a5b04e3, 0x77f3608e92adb243}, + {0xb267ed1940f1c61c, 0x55f038b237591ed4}, + {0xdf01e85f912e37a3, 0x6b6c46dec52f6689}, + {0x8b61313bbabce2c6, 0x2323ac4b3b3da016}, + {0xae397d8aa96c1b77, 0xabec975e0a0d081b}, + {0xd9c7dced53c72255, 0x96e7bd358c904a22}, + {0x881cea14545c7575, 0x7e50d64177da2e55}, + {0xaa242499697392d2, 0xdde50bd1d5d0b9ea}, + {0xd4ad2dbfc3d07787, 0x955e4ec64b44e865}, + {0x84ec3c97da624ab4, 0xbd5af13bef0b113f}, + {0xa6274bbdd0fadd61, 0xecb1ad8aeacdd58f}, + {0xcfb11ead453994ba, 0x67de18eda5814af3}, + {0x81ceb32c4b43fcf4, 0x80eacf948770ced8}, + {0xa2425ff75e14fc31, 0xa1258379a94d028e}, + {0xcad2f7f5359a3b3e, 0x096ee45813a04331}, + {0xfd87b5f28300ca0d, 0x8bca9d6e188853fd}, + {0x9e74d1b791e07e48, 0x775ea264cf55347e}, + {0xc612062576589dda, 0x95364afe032a819e}, + {0xf79687aed3eec551, 0x3a83ddbd83f52205}, + {0x9abe14cd44753b52, 0xc4926a9672793543}, + {0xc16d9a0095928a27, 0x75b7053c0f178294}, + {0xf1c90080baf72cb1, 0x5324c68b12dd6339}, + {0x971da05074da7bee, 0xd3f6fc16ebca5e04}, + {0xbce5086492111aea, 0x88f4bb1ca6bcf585}, + {0xec1e4a7db69561a5, 0x2b31e9e3d06c32e6}, + {0x9392ee8e921d5d07, 0x3aff322e62439fd0}, + {0xb877aa3236a4b449, 0x09befeb9fad487c3}, + {0xe69594bec44de15b, 0x4c2ebe687989a9b4}, + {0x901d7cf73ab0acd9, 0x0f9d37014bf60a11}, + {0xb424dc35095cd80f, 0x538484c19ef38c95}, + {0xe12e13424bb40e13, 0x2865a5f206b06fba}, + {0x8cbccc096f5088cb, 0xf93f87b7442e45d4}, + {0xafebff0bcb24aafe, 0xf78f69a51539d749}, + {0xdbe6fecebdedd5be, 0xb573440e5a884d1c}, + {0x89705f4136b4a597, 0x31680a88f8953031}, + {0xabcc77118461cefc, 0xfdc20d2b36ba7c3e}, + {0xd6bf94d5e57a42bc, 0x3d32907604691b4d}, + {0x8637bd05af6c69b5, 0xa63f9a49c2c1b110}, + {0xa7c5ac471b478423, 0x0fcf80dc33721d54}, + {0xd1b71758e219652b, 0xd3c36113404ea4a9}, + {0x83126e978d4fdf3b, 0x645a1cac083126ea}, + {0xa3d70a3d70a3d70a, 0x3d70a3d70a3d70a4}, + {0xcccccccccccccccc, 0xcccccccccccccccd}, + {0x8000000000000000, 0x0000000000000000}, + {0xa000000000000000, 0x0000000000000000}, + {0xc800000000000000, 0x0000000000000000}, + {0xfa00000000000000, 0x0000000000000000}, + {0x9c40000000000000, 0x0000000000000000}, + {0xc350000000000000, 0x0000000000000000}, + {0xf424000000000000, 0x0000000000000000}, + {0x9896800000000000, 0x0000000000000000}, + {0xbebc200000000000, 0x0000000000000000}, + {0xee6b280000000000, 0x0000000000000000}, + {0x9502f90000000000, 0x0000000000000000}, + {0xba43b74000000000, 0x0000000000000000}, + {0xe8d4a51000000000, 0x0000000000000000}, + {0x9184e72a00000000, 0x0000000000000000}, + {0xb5e620f480000000, 0x0000000000000000}, + {0xe35fa931a0000000, 0x0000000000000000}, + {0x8e1bc9bf04000000, 0x0000000000000000}, + {0xb1a2bc2ec5000000, 0x0000000000000000}, + {0xde0b6b3a76400000, 0x0000000000000000}, + {0x8ac7230489e80000, 0x0000000000000000}, + {0xad78ebc5ac620000, 0x0000000000000000}, + {0xd8d726b7177a8000, 0x0000000000000000}, + {0x878678326eac9000, 0x0000000000000000}, + {0xa968163f0a57b400, 0x0000000000000000}, + {0xd3c21bcecceda100, 0x0000000000000000}, + {0x84595161401484a0, 0x0000000000000000}, + {0xa56fa5b99019a5c8, 0x0000000000000000}, + {0xcecb8f27f4200f3a, 0x0000000000000000}, + {0x813f3978f8940984, 0x4000000000000000}, + {0xa18f07d736b90be5, 0x5000000000000000}, + {0xc9f2c9cd04674ede, 0xa400000000000000}, + {0xfc6f7c4045812296, 0x4d00000000000000}, + {0x9dc5ada82b70b59d, 0xf020000000000000}, + {0xc5371912364ce305, 0x6c28000000000000}, + {0xf684df56c3e01bc6, 0xc732000000000000}, + {0x9a130b963a6c115c, 0x3c7f400000000000}, + {0xc097ce7bc90715b3, 0x4b9f100000000000}, + {0xf0bdc21abb48db20, 0x1e86d40000000000}, + {0x96769950b50d88f4, 0x1314448000000000}, + {0xbc143fa4e250eb31, 0x17d955a000000000}, + {0xeb194f8e1ae525fd, 0x5dcfab0800000000}, + {0x92efd1b8d0cf37be, 0x5aa1cae500000000}, + {0xb7abc627050305ad, 0xf14a3d9e40000000}, + {0xe596b7b0c643c719, 0x6d9ccd05d0000000}, + {0x8f7e32ce7bea5c6f, 0xe4820023a2000000}, + {0xb35dbf821ae4f38b, 0xdda2802c8a800000}, + {0xe0352f62a19e306e, 0xd50b2037ad200000}, + {0x8c213d9da502de45, 0x4526f422cc340000}, + {0xaf298d050e4395d6, 0x9670b12b7f410000}, + {0xdaf3f04651d47b4c, 0x3c0cdd765f114000}, + {0x88d8762bf324cd0f, 0xa5880a69fb6ac800}, + {0xab0e93b6efee0053, 0x8eea0d047a457a00}, + {0xd5d238a4abe98068, 0x72a4904598d6d880}, + {0x85a36366eb71f041, 0x47a6da2b7f864750}, + {0xa70c3c40a64e6c51, 0x999090b65f67d924}, + {0xd0cf4b50cfe20765, 0xfff4b4e3f741cf6d}, + {0x82818f1281ed449f, 0xbff8f10e7a8921a5}, + {0xa321f2d7226895c7, 0xaff72d52192b6a0e}, + {0xcbea6f8ceb02bb39, 0x9bf4f8a69f764491}, + {0xfee50b7025c36a08, 0x02f236d04753d5b5}, + {0x9f4f2726179a2245, 0x01d762422c946591}, + {0xc722f0ef9d80aad6, 0x424d3ad2b7b97ef6}, + {0xf8ebad2b84e0d58b, 0xd2e0898765a7deb3}, + {0x9b934c3b330c8577, 0x63cc55f49f88eb30}, + {0xc2781f49ffcfa6d5, 0x3cbf6b71c76b25fc}, + {0xf316271c7fc3908a, 0x8bef464e3945ef7b}, + {0x97edd871cfda3a56, 0x97758bf0e3cbb5ad}, + {0xbde94e8e43d0c8ec, 0x3d52eeed1cbea318}, + {0xed63a231d4c4fb27, 0x4ca7aaa863ee4bde}, + {0x945e455f24fb1cf8, 0x8fe8caa93e74ef6b}, + {0xb975d6b6ee39e436, 0xb3e2fd538e122b45}, + {0xe7d34c64a9c85d44, 0x60dbbca87196b617}, + {0x90e40fbeea1d3a4a, 0xbc8955e946fe31ce}, + {0xb51d13aea4a488dd, 0x6babab6398bdbe42}, + {0xe264589a4dcdab14, 0xc696963c7eed2dd2}, + {0x8d7eb76070a08aec, 0xfc1e1de5cf543ca3}, + {0xb0de65388cc8ada8, 0x3b25a55f43294bcc}, + {0xdd15fe86affad912, 0x49ef0eb713f39ebf}, + {0x8a2dbf142dfcc7ab, 0x6e3569326c784338}, + {0xacb92ed9397bf996, 0x49c2c37f07965405}, + {0xd7e77a8f87daf7fb, 0xdc33745ec97be907}, + {0x86f0ac99b4e8dafd, 0x69a028bb3ded71a4}, + {0xa8acd7c0222311bc, 0xc40832ea0d68ce0d}, + {0xd2d80db02aabd62b, 0xf50a3fa490c30191}, + {0x83c7088e1aab65db, 0x792667c6da79e0fb}, + {0xa4b8cab1a1563f52, 0x577001b891185939}, + {0xcde6fd5e09abcf26, 0xed4c0226b55e6f87}, + {0x80b05e5ac60b6178, 0x544f8158315b05b5}, + {0xa0dc75f1778e39d6, 0x696361ae3db1c722}, + {0xc913936dd571c84c, 0x03bc3a19cd1e38ea}, + {0xfb5878494ace3a5f, 0x04ab48a04065c724}, + {0x9d174b2dcec0e47b, 0x62eb0d64283f9c77}, + {0xc45d1df942711d9a, 0x3ba5d0bd324f8395}, + {0xf5746577930d6500, 0xca8f44ec7ee3647a}, + {0x9968bf6abbe85f20, 0x7e998b13cf4e1ecc}, + {0xbfc2ef456ae276e8, 0x9e3fedd8c321a67f}, + {0xefb3ab16c59b14a2, 0xc5cfe94ef3ea101f}, + {0x95d04aee3b80ece5, 0xbba1f1d158724a13}, + {0xbb445da9ca61281f, 0x2a8a6e45ae8edc98}, + {0xea1575143cf97226, 0xf52d09d71a3293be}, + {0x924d692ca61be758, 0x593c2626705f9c57}, + {0xb6e0c377cfa2e12e, 0x6f8b2fb00c77836d}, + {0xe498f455c38b997a, 0x0b6dfb9c0f956448}, + {0x8edf98b59a373fec, 0x4724bd4189bd5ead}, + {0xb2977ee300c50fe7, 0x58edec91ec2cb658}, + {0xdf3d5e9bc0f653e1, 0x2f2967b66737e3ee}, + {0x8b865b215899f46c, 0xbd79e0d20082ee75}, + {0xae67f1e9aec07187, 0xecd8590680a3aa12}, + {0xda01ee641a708de9, 0xe80e6f4820cc9496}, + {0x884134fe908658b2, 0x3109058d147fdcde}, + {0xaa51823e34a7eede, 0xbd4b46f0599fd416}, + {0xd4e5e2cdc1d1ea96, 0x6c9e18ac7007c91b}, + {0x850fadc09923329e, 0x03e2cf6bc604ddb1}, + {0xa6539930bf6bff45, 0x84db8346b786151d}, + {0xcfe87f7cef46ff16, 0xe612641865679a64}, + {0x81f14fae158c5f6e, 0x4fcb7e8f3f60c07f}, + {0xa26da3999aef7749, 0xe3be5e330f38f09e}, + {0xcb090c8001ab551c, 0x5cadf5bfd3072cc6}, + {0xfdcb4fa002162a63, 0x73d9732fc7c8f7f7}, + {0x9e9f11c4014dda7e, 0x2867e7fddcdd9afb}, + {0xc646d63501a1511d, 0xb281e1fd541501b9}, + {0xf7d88bc24209a565, 0x1f225a7ca91a4227}, + {0x9ae757596946075f, 0x3375788de9b06959}, + {0xc1a12d2fc3978937, 0x0052d6b1641c83af}, + {0xf209787bb47d6b84, 0xc0678c5dbd23a49b}, + {0x9745eb4d50ce6332, 0xf840b7ba963646e1}, + {0xbd176620a501fbff, 0xb650e5a93bc3d899}, + {0xec5d3fa8ce427aff, 0xa3e51f138ab4cebf}, + {0x93ba47c980e98cdf, 0xc66f336c36b10138}, + {0xb8a8d9bbe123f017, 0xb80b0047445d4185}, + {0xe6d3102ad96cec1d, 0xa60dc059157491e6}, + {0x9043ea1ac7e41392, 0x87c89837ad68db30}, + {0xb454e4a179dd1877, 0x29babe4598c311fc}, + {0xe16a1dc9d8545e94, 0xf4296dd6fef3d67b}, + {0x8ce2529e2734bb1d, 0x1899e4a65f58660d}, + {0xb01ae745b101e9e4, 0x5ec05dcff72e7f90}, + {0xdc21a1171d42645d, 0x76707543f4fa1f74}, + {0x899504ae72497eba, 0x6a06494a791c53a9}, + {0xabfa45da0edbde69, 0x0487db9d17636893}, + {0xd6f8d7509292d603, 0x45a9d2845d3c42b7}, + {0x865b86925b9bc5c2, 0x0b8a2392ba45a9b3}, + {0xa7f26836f282b732, 0x8e6cac7768d7141f}, + {0xd1ef0244af2364ff, 0x3207d795430cd927}, + {0x8335616aed761f1f, 0x7f44e6bd49e807b9}, + {0xa402b9c5a8d3a6e7, 0x5f16206c9c6209a7}, + {0xcd036837130890a1, 0x36dba887c37a8c10}, + {0x802221226be55a64, 0xc2494954da2c978a}, + {0xa02aa96b06deb0fd, 0xf2db9baa10b7bd6d}, + {0xc83553c5c8965d3d, 0x6f92829494e5acc8}, + {0xfa42a8b73abbf48c, 0xcb772339ba1f17fa}, + {0x9c69a97284b578d7, 0xff2a760414536efc}, + {0xc38413cf25e2d70d, 0xfef5138519684abb}, + {0xf46518c2ef5b8cd1, 0x7eb258665fc25d6a}, + {0x98bf2f79d5993802, 0xef2f773ffbd97a62}, + {0xbeeefb584aff8603, 0xaafb550ffacfd8fb}, + {0xeeaaba2e5dbf6784, 0x95ba2a53f983cf39}, + {0x952ab45cfa97a0b2, 0xdd945a747bf26184}, + {0xba756174393d88df, 0x94f971119aeef9e5}, + {0xe912b9d1478ceb17, 0x7a37cd5601aab85e}, + {0x91abb422ccb812ee, 0xac62e055c10ab33b}, + {0xb616a12b7fe617aa, 0x577b986b314d600a}, + {0xe39c49765fdf9d94, 0xed5a7e85fda0b80c}, + {0x8e41ade9fbebc27d, 0x14588f13be847308}, + {0xb1d219647ae6b31c, 0x596eb2d8ae258fc9}, + {0xde469fbd99a05fe3, 0x6fca5f8ed9aef3bc}, + {0x8aec23d680043bee, 0x25de7bb9480d5855}, + {0xada72ccc20054ae9, 0xaf561aa79a10ae6b}, + {0xd910f7ff28069da4, 0x1b2ba1518094da05}, + {0x87aa9aff79042286, 0x90fb44d2f05d0843}, + {0xa99541bf57452b28, 0x353a1607ac744a54}, + {0xd3fa922f2d1675f2, 0x42889b8997915ce9}, + {0x847c9b5d7c2e09b7, 0x69956135febada12}, + {0xa59bc234db398c25, 0x43fab9837e699096}, + {0xcf02b2c21207ef2e, 0x94f967e45e03f4bc}, + {0x8161afb94b44f57d, 0x1d1be0eebac278f6}, + {0xa1ba1ba79e1632dc, 0x6462d92a69731733}, + {0xca28a291859bbf93, 0x7d7b8f7503cfdcff}, + {0xfcb2cb35e702af78, 0x5cda735244c3d43f}, + {0x9defbf01b061adab, 0x3a0888136afa64a8}, + {0xc56baec21c7a1916, 0x088aaa1845b8fdd1}, + {0xf6c69a72a3989f5b, 0x8aad549e57273d46}, + {0x9a3c2087a63f6399, 0x36ac54e2f678864c}, + {0xc0cb28a98fcf3c7f, 0x84576a1bb416a7de}, + {0xf0fdf2d3f3c30b9f, 0x656d44a2a11c51d6}, + {0x969eb7c47859e743, 0x9f644ae5a4b1b326}, + {0xbc4665b596706114, 0x873d5d9f0dde1fef}, + {0xeb57ff22fc0c7959, 0xa90cb506d155a7eb}, + {0x9316ff75dd87cbd8, 0x09a7f12442d588f3}, + {0xb7dcbf5354e9bece, 0x0c11ed6d538aeb30}, + {0xe5d3ef282a242e81, 0x8f1668c8a86da5fb}, + {0x8fa475791a569d10, 0xf96e017d694487bd}, + {0xb38d92d760ec4455, 0x37c981dcc395a9ad}, + {0xe070f78d3927556a, 0x85bbe253f47b1418}, + {0x8c469ab843b89562, 0x93956d7478ccec8f}, + {0xaf58416654a6babb, 0x387ac8d1970027b3}, + {0xdb2e51bfe9d0696a, 0x06997b05fcc0319f}, + {0x88fcf317f22241e2, 0x441fece3bdf81f04}, + {0xab3c2fddeeaad25a, 0xd527e81cad7626c4}, + {0xd60b3bd56a5586f1, 0x8a71e223d8d3b075}, + {0x85c7056562757456, 0xf6872d5667844e4a}, + {0xa738c6bebb12d16c, 0xb428f8ac016561dc}, + {0xd106f86e69d785c7, 0xe13336d701beba53}, + {0x82a45b450226b39c, 0xecc0024661173474}, + {0xa34d721642b06084, 0x27f002d7f95d0191}, + {0xcc20ce9bd35c78a5, 0x31ec038df7b441f5}, + {0xff290242c83396ce, 0x7e67047175a15272}, + {0x9f79a169bd203e41, 0x0f0062c6e984d387}, + {0xc75809c42c684dd1, 0x52c07b78a3e60869}, + {0xf92e0c3537826145, 0xa7709a56ccdf8a83}, + {0x9bbcc7a142b17ccb, 0x88a66076400bb692}, + {0xc2abf989935ddbfe, 0x6acff893d00ea436}, + {0xf356f7ebf83552fe, 0x0583f6b8c4124d44}, + {0x98165af37b2153de, 0xc3727a337a8b704b}, + {0xbe1bf1b059e9a8d6, 0x744f18c0592e4c5d}, + {0xeda2ee1c7064130c, 0x1162def06f79df74}, + {0x9485d4d1c63e8be7, 0x8addcb5645ac2ba9}, + {0xb9a74a0637ce2ee1, 0x6d953e2bd7173693}, + {0xe8111c87c5c1ba99, 0xc8fa8db6ccdd0438}, + {0x910ab1d4db9914a0, 0x1d9c9892400a22a3}, + {0xb54d5e4a127f59c8, 0x2503beb6d00cab4c}, + {0xe2a0b5dc971f303a, 0x2e44ae64840fd61e}, + {0x8da471a9de737e24, 0x5ceaecfed289e5d3}, + {0xb10d8e1456105dad, 0x7425a83e872c5f48}, + {0xdd50f1996b947518, 0xd12f124e28f7771a}, + {0x8a5296ffe33cc92f, 0x82bd6b70d99aaa70}, + {0xace73cbfdc0bfb7b, 0x636cc64d1001550c}, + {0xd8210befd30efa5a, 0x3c47f7e05401aa4f}, + {0x8714a775e3e95c78, 0x65acfaec34810a72}, + {0xa8d9d1535ce3b396, 0x7f1839a741a14d0e}, + {0xd31045a8341ca07c, 0x1ede48111209a051}, + {0x83ea2b892091e44d, 0x934aed0aab460433}, + {0xa4e4b66b68b65d60, 0xf81da84d56178540}, + {0xce1de40642e3f4b9, 0x36251260ab9d668f}, + {0x80d2ae83e9ce78f3, 0xc1d72b7c6b42601a}, + {0xa1075a24e4421730, 0xb24cf65b8612f820}, + {0xc94930ae1d529cfc, 0xdee033f26797b628}, + {0xfb9b7cd9a4a7443c, 0x169840ef017da3b2}, + {0x9d412e0806e88aa5, 0x8e1f289560ee864f}, + {0xc491798a08a2ad4e, 0xf1a6f2bab92a27e3}, + {0xf5b5d7ec8acb58a2, 0xae10af696774b1dc}, + {0x9991a6f3d6bf1765, 0xacca6da1e0a8ef2a}, + {0xbff610b0cc6edd3f, 0x17fd090a58d32af4}, + {0xeff394dcff8a948e, 0xddfc4b4cef07f5b1}, + {0x95f83d0a1fb69cd9, 0x4abdaf101564f98f}, + {0xbb764c4ca7a4440f, 0x9d6d1ad41abe37f2}, + {0xea53df5fd18d5513, 0x84c86189216dc5ee}, + {0x92746b9be2f8552c, 0x32fd3cf5b4e49bb5}, + {0xb7118682dbb66a77, 0x3fbc8c33221dc2a2}, + {0xe4d5e82392a40515, 0x0fabaf3feaa5334b}, + {0x8f05b1163ba6832d, 0x29cb4d87f2a7400f}, + {0xb2c71d5bca9023f8, 0x743e20e9ef511013}, + {0xdf78e4b2bd342cf6, 0x914da9246b255417}, + {0x8bab8eefb6409c1a, 0x1ad089b6c2f7548f}, + {0xae9672aba3d0c320, 0xa184ac2473b529b2}, + {0xda3c0f568cc4f3e8, 0xc9e5d72d90a2741f}, + {0x8865899617fb1871, 0x7e2fa67c7a658893}, + {0xaa7eebfb9df9de8d, 0xddbb901b98feeab8}, + {0xd51ea6fa85785631, 0x552a74227f3ea566}, + {0x8533285c936b35de, 0xd53a88958f872760}, + {0xa67ff273b8460356, 0x8a892abaf368f138}, + {0xd01fef10a657842c, 0x2d2b7569b0432d86}, + {0x8213f56a67f6b29b, 0x9c3b29620e29fc74}, + {0xa298f2c501f45f42, 0x8349f3ba91b47b90}, + {0xcb3f2f7642717713, 0x241c70a936219a74}, + {0xfe0efb53d30dd4d7, 0xed238cd383aa0111}, + {0x9ec95d1463e8a506, 0xf4363804324a40ab}, + {0xc67bb4597ce2ce48, 0xb143c6053edcd0d6}, + {0xf81aa16fdc1b81da, 0xdd94b7868e94050b}, + {0x9b10a4e5e9913128, 0xca7cf2b4191c8327}, + {0xc1d4ce1f63f57d72, 0xfd1c2f611f63a3f1}, + {0xf24a01a73cf2dccf, 0xbc633b39673c8ced}, + {0x976e41088617ca01, 0xd5be0503e085d814}, + {0xbd49d14aa79dbc82, 0x4b2d8644d8a74e19}, + {0xec9c459d51852ba2, 0xddf8e7d60ed1219f}, + {0x93e1ab8252f33b45, 0xcabb90e5c942b504}, + {0xb8da1662e7b00a17, 0x3d6a751f3b936244}, + {0xe7109bfba19c0c9d, 0x0cc512670a783ad5}, + {0x906a617d450187e2, 0x27fb2b80668b24c6}, + {0xb484f9dc9641e9da, 0xb1f9f660802dedf7}, + {0xe1a63853bbd26451, 0x5e7873f8a0396974}, + {0x8d07e33455637eb2, 0xdb0b487b6423e1e9}, + {0xb049dc016abc5e5f, 0x91ce1a9a3d2cda63}, + {0xdc5c5301c56b75f7, 0x7641a140cc7810fc}, + {0x89b9b3e11b6329ba, 0xa9e904c87fcb0a9e}, + {0xac2820d9623bf429, 0x546345fa9fbdcd45}, + {0xd732290fbacaf133, 0xa97c177947ad4096}, + {0x867f59a9d4bed6c0, 0x49ed8eabcccc485e}, + {0xa81f301449ee8c70, 0x5c68f256bfff5a75}, + {0xd226fc195c6a2f8c, 0x73832eec6fff3112}, + {0x83585d8fd9c25db7, 0xc831fd53c5ff7eac}, + {0xa42e74f3d032f525, 0xba3e7ca8b77f5e56}, + {0xcd3a1230c43fb26f, 0x28ce1bd2e55f35ec}, + {0x80444b5e7aa7cf85, 0x7980d163cf5b81b4}, + {0xa0555e361951c366, 0xd7e105bcc3326220}, + {0xc86ab5c39fa63440, 0x8dd9472bf3fefaa8}, + {0xfa856334878fc150, 0xb14f98f6f0feb952}, + {0x9c935e00d4b9d8d2, 0x6ed1bf9a569f33d4}, + {0xc3b8358109e84f07, 0x0a862f80ec4700c9}, + {0xf4a642e14c6262c8, 0xcd27bb612758c0fb}, + {0x98e7e9cccfbd7dbd, 0x8038d51cb897789d}, + {0xbf21e44003acdd2c, 0xe0470a63e6bd56c4}, + {0xeeea5d5004981478, 0x1858ccfce06cac75}, + {0x95527a5202df0ccb, 0x0f37801e0c43ebc9}, + {0xbaa718e68396cffd, 0xd30560258f54e6bb}, + {0xe950df20247c83fd, 0x47c6b82ef32a206a}, + {0x91d28b7416cdd27e, 0x4cdc331d57fa5442}, + {0xb6472e511c81471d, 0xe0133fe4adf8e953}, + {0xe3d8f9e563a198e5, 0x58180fddd97723a7}, + {0x8e679c2f5e44ff8f, 0x570f09eaa7ea7649}, + {0xb201833b35d63f73, 0x2cd2cc6551e513db}, + {0xde81e40a034bcf4f, 0xf8077f7ea65e58d2}, + {0x8b112e86420f6191, 0xfb04afaf27faf783}, + {0xadd57a27d29339f6, 0x79c5db9af1f9b564}, + {0xd94ad8b1c7380874, 0x18375281ae7822bd}, + {0x87cec76f1c830548, 0x8f2293910d0b15b6}, + {0xa9c2794ae3a3c69a, 0xb2eb3875504ddb23}, + {0xd433179d9c8cb841, 0x5fa60692a46151ec}, + {0x849feec281d7f328, 0xdbc7c41ba6bcd334}, + {0xa5c7ea73224deff3, 0x12b9b522906c0801}, + {0xcf39e50feae16bef, 0xd768226b34870a01}, + {0x81842f29f2cce375, 0xe6a1158300d46641}, + {0xa1e53af46f801c53, 0x60495ae3c1097fd1}, + {0xca5e89b18b602368, 0x385bb19cb14bdfc5}, + {0xfcf62c1dee382c42, 0x46729e03dd9ed7b6}, + {0x9e19db92b4e31ba9, 0x6c07a2c26a8346d2}, + {0xc5a05277621be293, 0xc7098b7305241886}, + {0xf70867153aa2db38, 0xb8cbee4fc66d1ea8}, + {0x9a65406d44a5c903, 0x737f74f1dc043329}, + {0xc0fe908895cf3b44, 0x505f522e53053ff3}, + {0xf13e34aabb430a15, 0x647726b9e7c68ff0}, + {0x96c6e0eab509e64d, 0x5eca783430dc19f6}, + {0xbc789925624c5fe0, 0xb67d16413d132073}, + {0xeb96bf6ebadf77d8, 0xe41c5bd18c57e890}, + {0x933e37a534cbaae7, 0x8e91b962f7b6f15a}, + {0xb80dc58e81fe95a1, 0x723627bbb5a4adb1}, + {0xe61136f2227e3b09, 0xcec3b1aaa30dd91d}, + {0x8fcac257558ee4e6, 0x213a4f0aa5e8a7b2}, + {0xb3bd72ed2af29e1f, 0xa988e2cd4f62d19e}, + {0xe0accfa875af45a7, 0x93eb1b80a33b8606}, + {0x8c6c01c9498d8b88, 0xbc72f130660533c4}, + {0xaf87023b9bf0ee6a, 0xeb8fad7c7f8680b5}, + {0xdb68c2ca82ed2a05, 0xa67398db9f6820e2}, #else - {0xff77b1fcbebcdc4f, 0x25e8e89c13bb0f7b}, - {0xce5d73ff402d98e3, 0xfb0a3d212dc81290}, - {0xa6b34ad8c9dfc06f, 0xf42faa48c0ea481f}, - {0x86a8d39ef77164bc, 0xae5dff9c02033198}, - {0xd98ddaee19068c76, 0x3badd624dd9b0958}, - {0xafbd2350644eeacf, 0xe5d1929ef90898fb}, - {0x8df5efabc5979c8f, 0xca8d3ffa1ef463c2}, - {0xe55990879ddcaabd, 0xcc420a6a101d0516}, - {0xb94470938fa89bce, 0xf808e40e8d5b3e6a}, - {0x95a8637627989aad, 0xdde7001379a44aa9}, - {0xf1c90080baf72cb1, 0x5324c68b12dd6339}, - {0xc350000000000000, 0x0000000000000000}, - {0x9dc5ada82b70b59d, 0xf020000000000000}, - {0xfee50b7025c36a08, 0x02f236d04753d5b5}, - {0xcde6fd5e09abcf26, 0xed4c0226b55e6f87}, - {0xa6539930bf6bff45, 0x84db8346b786151d}, - {0x865b86925b9bc5c2, 0x0b8a2392ba45a9b3}, - {0xd910f7ff28069da4, 0x1b2ba1518094da05}, - {0xaf58416654a6babb, 0x387ac8d1970027b3}, - {0x8da471a9de737e24, 0x5ceaecfed289e5d3}, - {0xe4d5e82392a40515, 0x0fabaf3feaa5334b}, - {0xb8da1662e7b00a17, 0x3d6a751f3b936244}, - {0x95527a5202df0ccb, 0x0f37801e0c43ebc9}, - {0xf13e34aabb430a15, 0x647726b9e7c68ff0} + {0xff77b1fcbebcdc4f, 0x25e8e89c13bb0f7b}, + {0xce5d73ff402d98e3, 0xfb0a3d212dc81290}, + {0xa6b34ad8c9dfc06f, 0xf42faa48c0ea481f}, + {0x86a8d39ef77164bc, 0xae5dff9c02033198}, + {0xd98ddaee19068c76, 0x3badd624dd9b0958}, + {0xafbd2350644eeacf, 0xe5d1929ef90898fb}, + {0x8df5efabc5979c8f, 0xca8d3ffa1ef463c2}, + {0xe55990879ddcaabd, 0xcc420a6a101d0516}, + {0xb94470938fa89bce, 0xf808e40e8d5b3e6a}, + {0x95a8637627989aad, 0xdde7001379a44aa9}, + {0xf1c90080baf72cb1, 0x5324c68b12dd6339}, + {0xc350000000000000, 0x0000000000000000}, + {0x9dc5ada82b70b59d, 0xf020000000000000}, + {0xfee50b7025c36a08, 0x02f236d04753d5b5}, + {0xcde6fd5e09abcf26, 0xed4c0226b55e6f87}, + {0xa6539930bf6bff45, 0x84db8346b786151d}, + {0x865b86925b9bc5c2, 0x0b8a2392ba45a9b3}, + {0xd910f7ff28069da4, 0x1b2ba1518094da05}, + {0xaf58416654a6babb, 0x387ac8d1970027b3}, + {0x8da471a9de737e24, 0x5ceaecfed289e5d3}, + {0xe4d5e82392a40515, 0x0fabaf3feaa5334b}, + {0xb8da1662e7b00a17, 0x3d6a751f3b936244}, + {0x95527a5202df0ccb, 0x0f37801e0c43ebc9}, + {0xf13e34aabb430a15, 0x647726b9e7c68ff0} #endif }; @@ -1058,7 +1075,7 @@ template <> struct cache_accessor { int offset = k - kb; // Get base cache. - uint128_fallback base_cache = pow10_significands[cache_index]; + uint128 base_cache = pow10_significands[cache_index]; if (offset == 0) return base_cache; // Compute the required amount of bit-shift. @@ -1067,17 +1084,16 @@ template <> struct cache_accessor { // Try to recover the real cache. uint64_t pow5 = powers_of_5_64[offset]; - uint128_fallback recovered_cache = umul128(base_cache.high(), pow5); - uint128_fallback middle_low = umul128(base_cache.low(), pow5); + uint128 recovered_cache = umul128(base_cache.high(), pow5); + uint128 middle_low = umul128(base_cache.low(), pow5); recovered_cache += middle_low.high(); uint64_t high_to_middle = recovered_cache.high() << (64 - alpha); uint64_t middle_to_low = recovered_cache.low() << (64 - alpha); - recovered_cache = - uint128_fallback{(recovered_cache.low() >> alpha) | high_to_middle, - ((middle_low.low() >> alpha) | middle_to_low)}; + recovered_cache = uint128{(recovered_cache.low() >> alpha) | high_to_middle, + ((middle_low.low() >> alpha) | middle_to_low)}; FMT_ASSERT(recovered_cache.low() + 1 != 0, ""); return {recovered_cache.high(), recovered_cache.low() + 1}; #endif @@ -1138,7 +1154,7 @@ template <> struct cache_accessor { } }; -FMT_FUNC auto get_cached_power(int k) noexcept -> uint128_fallback { +FMT_FUNC auto get_cached_power(int k) noexcept -> uint128 { return cache_accessor::get_cached_power(k); } @@ -1463,10 +1479,10 @@ template struct span { }; template auto flockfile(F* f) -> decltype(_lock_file(f)) { - _lock_file(f); + return _lock_file(f); } template auto funlockfile(F* f) -> decltype(_unlock_file(f)) { - _unlock_file(f); + return _unlock_file(f); } #ifndef getc_unlocked @@ -1475,12 +1491,16 @@ template auto getc_unlocked(F* f) -> decltype(_fgetc_nolock(f)) { } #endif +#ifndef FMT_USE_FLOCKFILE +# define FMT_USE_FLOCKFILE 1 +#endif + template struct has_flockfile : std::false_type {}; template struct has_flockfile()))>> - : std::true_type {}; + : bool_constant {}; // A FILE wrapper. F is FILE defined as a template parameter to make system API // detection work. @@ -1678,6 +1698,9 @@ class file_print_buffer::value>> public: explicit file_print_buffer(F* f) : buffer(grow, size_t()), file_(f) { flockfile(f); +#ifdef __SANITIZE_THREAD__ + __tsan_acquire(f); +#endif file_.init_buffer(); auto buf = file_.get_write_buffer(); set(buf.data, buf.size); @@ -1685,7 +1708,10 @@ class file_print_buffer::value>> ~file_print_buffer() { file_.advance_write_buffer(size()); bool flush = file_.needs_flush(); - F* f = file_; // Make funlockfile depend on the template parameter F + F* f = file_; // Make funlockfile depend on the template parameter F. +#ifdef __SANITIZE_THREAD__ + __tsan_release(f); +#endif funlockfile(f); // for the system API detection to work. if (flush) fflush(file_); } diff --git a/dep/fmt/include/fmt/format.h b/dep/fmt/include/fmt/format.h index 4a6530072..5044befdd 100644 --- a/dep/fmt/include/fmt/format.h +++ b/dep/fmt/include/fmt/format.h @@ -1,7 +1,7 @@ /* Formatting library for C++ - Copyright (c) 2012 - present, Victor Zverovich + Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -47,14 +47,12 @@ #endif #ifndef FMT_MODULE +# include // uint32_t # include // malloc, free +# include // memcpy -# include // std::signbit -# include // std::byte -# include // uint32_t -# include // std::memcpy -# include // std::numeric_limits -# include // std::bad_alloc +# include // std::signbit +# include // std::numeric_limits # if defined(__GLIBCXX__) && !defined(_GLIBCXX_USE_DUAL_ABI) // Workaround for pre gcc 5 libstdc++. # include // std::allocator_traits @@ -122,14 +120,6 @@ # define FMT_NOINLINE #endif -#ifdef FMT_DEPRECATED -// Use the provided definition. -#elif FMT_HAS_CPP14_ATTRIBUTE(deprecated) -# define FMT_DEPRECATED [[deprecated]] -#else -# define FMT_DEPRECATED /* deprecated */ -#endif - // Detect constexpr std::string. #if !FMT_USE_CONSTEVAL # define FMT_USE_CONSTEXPR_STRING 0 @@ -224,7 +214,6 @@ namespace detail { inline auto clz(uint32_t x) -> int { FMT_ASSERT(x != 0, ""); - FMT_MSC_WARNING(suppress : 6102) // Suppress a bogus static analysis warning. unsigned long r = 0; _BitScanReverse(&r, x); return 31 ^ static_cast(r); @@ -233,7 +222,6 @@ inline auto clz(uint32_t x) -> int { inline auto clzll(uint64_t x) -> int { FMT_ASSERT(x != 0, ""); - FMT_MSC_WARNING(suppress : 6102) // Suppress a bogus static analysis warning. unsigned long r = 0; # ifdef _WIN64 _BitScanReverse64(&r, x); @@ -283,7 +271,7 @@ FMT_CONSTEXPR20 auto bit_cast(const From& from) -> To { #endif auto to = To(); // The cast suppresses a bogus -Wclass-memaccess on GCC. - std::memcpy(static_cast(&to), &from, sizeof(to)); + memcpy(static_cast(&to), &from, sizeof(to)); return to; } @@ -302,13 +290,13 @@ inline auto is_big_endian() -> bool { #endif } -class uint128_fallback { +class uint128 { private: uint64_t lo_, hi_; public: - constexpr uint128_fallback(uint64_t hi, uint64_t lo) : lo_(lo), hi_(hi) {} - constexpr uint128_fallback(uint64_t value = 0) : lo_(value), hi_(0) {} + constexpr uint128(uint64_t hi, uint64_t lo) : lo_(lo), hi_(hi) {} + constexpr uint128(uint64_t value = 0) : lo_(value), hi_(0) {} constexpr auto high() const noexcept -> uint64_t { return hi_; } constexpr auto low() const noexcept -> uint64_t { return lo_; } @@ -318,92 +306,84 @@ class uint128_fallback { return static_cast(lo_); } - friend constexpr auto operator==(const uint128_fallback& lhs, - const uint128_fallback& rhs) -> bool { + friend constexpr auto operator==(const uint128& lhs, const uint128& rhs) + -> bool { return lhs.hi_ == rhs.hi_ && lhs.lo_ == rhs.lo_; } - friend constexpr auto operator!=(const uint128_fallback& lhs, - const uint128_fallback& rhs) -> bool { + friend constexpr auto operator!=(const uint128& lhs, const uint128& rhs) + -> bool { return !(lhs == rhs); } - friend constexpr auto operator>(const uint128_fallback& lhs, - const uint128_fallback& rhs) -> bool { + friend constexpr auto operator>(const uint128& lhs, const uint128& rhs) + -> bool { return lhs.hi_ != rhs.hi_ ? lhs.hi_ > rhs.hi_ : lhs.lo_ > rhs.lo_; } - friend constexpr auto operator|(const uint128_fallback& lhs, - const uint128_fallback& rhs) - -> uint128_fallback { + friend constexpr auto operator|(const uint128& lhs, const uint128& rhs) + -> uint128 { return {lhs.hi_ | rhs.hi_, lhs.lo_ | rhs.lo_}; } - friend constexpr auto operator&(const uint128_fallback& lhs, - const uint128_fallback& rhs) - -> uint128_fallback { + friend constexpr auto operator&(const uint128& lhs, const uint128& rhs) + -> uint128 { return {lhs.hi_ & rhs.hi_, lhs.lo_ & rhs.lo_}; } - friend constexpr auto operator~(const uint128_fallback& n) - -> uint128_fallback { - return {~n.hi_, ~n.lo_}; - } - friend FMT_CONSTEXPR auto operator+(const uint128_fallback& lhs, - const uint128_fallback& rhs) - -> uint128_fallback { - auto result = uint128_fallback(lhs); + friend FMT_CONSTEXPR auto operator+(const uint128& lhs, const uint128& rhs) + -> uint128 { + auto result = uint128(lhs); result += rhs; return result; } - friend FMT_CONSTEXPR auto operator*(const uint128_fallback& lhs, uint32_t rhs) - -> uint128_fallback { + friend FMT_CONSTEXPR auto operator*(const uint128& lhs, uint32_t rhs) + -> uint128 { FMT_ASSERT(lhs.hi_ == 0, ""); uint64_t hi = (lhs.lo_ >> 32) * rhs; uint64_t lo = (lhs.lo_ & ~uint32_t()) * rhs; uint64_t new_lo = (hi << 32) + lo; return {(hi >> 32) + (new_lo < lo ? 1 : 0), new_lo}; } - friend constexpr auto operator-(const uint128_fallback& lhs, uint64_t rhs) - -> uint128_fallback { + friend constexpr auto operator-(const uint128& lhs, uint64_t rhs) -> uint128 { return {lhs.hi_ - (lhs.lo_ < rhs ? 1 : 0), lhs.lo_ - rhs}; } - FMT_CONSTEXPR auto operator>>(int shift) const -> uint128_fallback { + FMT_CONSTEXPR auto operator>>(int shift) const -> uint128 { if (shift == 64) return {0, hi_}; - if (shift > 64) return uint128_fallback(0, hi_) >> (shift - 64); + if (shift > 64) return uint128(0, hi_) >> (shift - 64); return {hi_ >> shift, (hi_ << (64 - shift)) | (lo_ >> shift)}; } - FMT_CONSTEXPR auto operator<<(int shift) const -> uint128_fallback { + FMT_CONSTEXPR auto operator<<(int shift) const -> uint128 { if (shift == 64) return {lo_, 0}; - if (shift > 64) return uint128_fallback(lo_, 0) << (shift - 64); + if (shift > 64) return uint128(lo_, 0) << (shift - 64); return {hi_ << shift | (lo_ >> (64 - shift)), (lo_ << shift)}; } - FMT_CONSTEXPR auto operator>>=(int shift) -> uint128_fallback& { + FMT_CONSTEXPR auto operator>>=(int shift) -> uint128& { return *this = *this >> shift; } - FMT_CONSTEXPR void operator+=(uint128_fallback n) { + FMT_CONSTEXPR void operator+=(uint128 n) { uint64_t new_lo = lo_ + n.lo_; uint64_t new_hi = hi_ + n.hi_ + (new_lo < lo_ ? 1 : 0); FMT_ASSERT(new_hi >= hi_, ""); lo_ = new_lo; hi_ = new_hi; } - FMT_CONSTEXPR void operator&=(uint128_fallback n) { + FMT_CONSTEXPR void operator&=(uint128 n) { lo_ &= n.lo_; hi_ &= n.hi_; } - FMT_CONSTEXPR20 auto operator+=(uint64_t n) noexcept -> uint128_fallback& { + FMT_CONSTEXPR20 auto operator+=(uint64_t n) noexcept -> uint128& { if (is_constant_evaluated()) { lo_ += n; hi_ += (lo_ < n ? 1 : 0); return *this; } #if FMT_HAS_BUILTIN(__builtin_addcll) && !defined(__ibmxl__) - unsigned long long carry; + ullong carry; lo_ = __builtin_addcll(lo_, n, 0, &carry); hi_ += carry; #elif FMT_HAS_BUILTIN(__builtin_ia32_addcarryx_u64) && !defined(__ibmxl__) - unsigned long long result; + ullong result; auto carry = __builtin_ia32_addcarryx_u64(0, lo_, n, &result); lo_ = result; hi_ += carry; -#elif defined(_MSC_VER) && defined(_M_X64) +#elif defined(_MSC_VER) && defined(_M_AMD64) auto carry = _addcarry_u64(0, lo_, n, &lo_); _addcarry_u64(carry, hi_, 0, &hi_); #else @@ -414,7 +394,7 @@ class uint128_fallback { } }; -using uint128_t = conditional_t; +using uint128_t = conditional_t; #ifdef UINTPTR_MAX using uintptr_t = ::uintptr_t; @@ -431,12 +411,12 @@ template constexpr auto num_bits() -> int { return std::numeric_limits::digits; } // std::numeric_limits::digits may return 0 for 128-bit ints. -template <> constexpr auto num_bits() -> int { return 128; } -template <> constexpr auto num_bits() -> int { return 128; } -template <> constexpr auto num_bits() -> int { return 128; } +template <> constexpr auto num_bits() -> int { return 128; } +template <> constexpr auto num_bits() -> int { return 128; } +template <> constexpr auto num_bits() -> int { return 128; } // A heterogeneous bit_cast used for converting 96-bit long double to uint128_t -// and 128-bit pointers to uint128_fallback. +// and 128-bit pointers to uint128. template sizeof(From))> inline auto bit_cast(const From& from) -> To { constexpr auto size = static_cast(sizeof(From) / sizeof(unsigned short)); @@ -444,7 +424,7 @@ inline auto bit_cast(const From& from) -> To { unsigned short value[static_cast(size)]; } data = bit_cast(from); auto result = To(); - if (const_check(is_big_endian())) { + if (is_big_endian()) { for (int i = 0; i < size; ++i) result = (result << num_bits()) | data.value[i]; } else { @@ -493,8 +473,8 @@ template = 307 && !FMT_ICC_VERSION __attribute__((no_sanitize("undefined"))) #endif -FMT_CONSTEXPR20 inline auto -reserve(OutputIt it, size_t n) -> typename OutputIt::value_type* { +FMT_CONSTEXPR20 inline auto reserve(OutputIt it, size_t n) -> + typename OutputIt::value_type* { auto& c = get_container(it); size_t size = c.size(); c.resize(size + n); @@ -564,10 +544,15 @@ FMT_CONSTEXPR20 auto fill_n(T* out, Size count, char value) -> T* { if (is_constant_evaluated()) return fill_n(out, count, value); static_assert(sizeof(T) == 1, "sizeof(T) must be 1 to use char for initialization"); - std::memset(out, value, to_unsigned(count)); + memset(out, value, to_unsigned(count)); return out + count; } +template +FMT_CONSTEXPR auto copy(basic_string_view s, OutputIt out) -> OutputIt { + return copy(s.begin(), s.end(), out); +} + template FMT_CONSTEXPR FMT_NOINLINE auto copy_noinline(InputIt begin, InputIt end, OutputIt out) -> OutputIt { @@ -690,13 +675,13 @@ FMT_CONSTEXPR inline auto display_width_of(uint32_t cp) noexcept -> size_t { } template struct is_integral : std::is_integral {}; -template <> struct is_integral : std::true_type {}; +template <> struct is_integral : std::true_type {}; template <> struct is_integral : std::true_type {}; template using is_signed = std::integral_constant::is_signed || - std::is_same::value>; + std::is_same::value>; template using is_integer = @@ -736,21 +721,17 @@ using fast_float_t = conditional_t; template using is_double_double = bool_constant::digits == 106>; -#ifndef FMT_USE_FULL_CACHE_DRAGONBOX -# define FMT_USE_FULL_CACHE_DRAGONBOX 0 -#endif +FMT_API auto allocate(size_t size) -> void*; // An allocator that uses malloc/free to allow removing dependency on the C++ -// standard libary runtime. std::decay is used for back_inserter to be found by +// standard library runtime. std::decay is used for back_inserter to be found by // ADL when applied to memory_buffer. template struct allocator : private std::decay { using value_type = T; auto allocate(size_t n) -> T* { FMT_ASSERT(n <= max_value() / sizeof(T), ""); - T* p = static_cast(malloc(n * sizeof(T))); - if (!p) FMT_THROW(std::bad_alloc()); - return p; + return static_cast(detail::allocate(n * sizeof(T))); } void deallocate(T* p, size_t) { free(p); } @@ -984,7 +965,7 @@ FMT_API void print(FILE*, string_view); namespace detail { template struct fixed_string { - FMT_CONSTEXPR20 fixed_string(const Char (&s)[N]) { + FMT_CONSTEXPR fixed_string(const Char (&s)[N]) { detail::copy(static_cast(s), s + N, data); } @@ -1031,12 +1012,12 @@ using uint64_or_128_t = conditional_t() <= 64, uint64_t, uint128_t>; (factor) * 100000, (factor) * 1000000, (factor) * 10000000, \ (factor) * 100000000, (factor) * 1000000000 -// Converts value in the range [0, 100) to a string. -// GCC generates slightly better code when value is pointer-size. -inline auto digits2(size_t value) -> const char* { +// Converts value in the range [0, 100) to a string. GCC generates a bit better +// code when value is pointer-size (https://www.godbolt.org/z/5fEPMT1cc). +inline auto digits2(size_t value) noexcept -> const char* { // Align data since unaligned access may be slower when crossing a // hardware-specific boundary. - alignas(2) static const char data[] = + alignas(2) static constexpr char data[] = "0001020304050607080910111213141516171819" "2021222324252627282930313233343536373839" "4041424344454647484950515253545556575859" @@ -1045,9 +1026,25 @@ inline auto digits2(size_t value) -> const char* { return &data[value * 2]; } +// Given i in [0, 100), let x be the first 7 digits after +// the decimal point of i / 100 in base 2, the first 2 bytes +// after digits2_i(x) is the string representation of i. +inline auto digits2_i(size_t value) noexcept -> const char* { + alignas(2) static constexpr char data[] = + "00010203 0405060707080910 1112" + "131414151617 18192021 222324 " + "25262728 2930313232333435 3637" + "383939404142 43444546 474849 " + "50515253 5455565757585960 6162" + "636464656667 68697071 727374 " + "75767778 7980818282838485 8687" + "888989909192 93949596 979899 "; + return &data[value * 2]; +} + template constexpr auto getsign(sign s) -> Char { - return static_cast(((' ' << 24) | ('+' << 16) | ('-' << 8)) >> - (static_cast(s) * 8)); + return static_cast(static_cast( + ((' ' << 24) | ('+' << 16) | ('-' << 8)) >> (static_cast(s) * 8))); } template FMT_CONSTEXPR auto count_digits_fallback(T n) -> int { @@ -1065,7 +1062,7 @@ template FMT_CONSTEXPR auto count_digits_fallback(T n) -> int { } } #if FMT_USE_INT128 -FMT_CONSTEXPR inline auto count_digits(uint128_opt n) -> int { +FMT_CONSTEXPR inline auto count_digits(native_uint128 n) -> int { return count_digits_fallback(n); } #endif @@ -1153,7 +1150,9 @@ FMT_CONSTEXPR20 inline auto count_digits(uint32_t n) -> int { template constexpr auto digits10() noexcept -> int { return std::numeric_limits::digits10; } -template <> constexpr auto digits10() noexcept -> int { return 38; } +template <> constexpr auto digits10() noexcept -> int { + return 38; +} template <> constexpr auto digits10() noexcept -> int { return 38; } template struct thousands_sep_result { @@ -1166,7 +1165,7 @@ FMT_API auto thousands_sep_impl(locale_ref loc) -> thousands_sep_result; template inline auto thousands_sep(locale_ref loc) -> thousands_sep_result { auto result = thousands_sep_impl(loc); - return {result.grouping, Char(result.thousands_sep)}; + return {std::move(result.grouping), Char(result.thousands_sep)}; } template <> inline auto thousands_sep(locale_ref loc) -> thousands_sep_result { @@ -1213,6 +1212,16 @@ FMT_CONSTEXPR20 FMT_INLINE void write2digits(Char* out, size_t value) { *out = static_cast('0' + value % 10); } +template +FMT_INLINE void write2digits_i(Char* out, size_t value) { + if (std::is_same::value && !FMT_OPTIMIZE_SIZE) { + memcpy(out, digits2_i(value), 2); + return; + } + *out++ = static_cast(digits2_i(value)[0]); + *out = static_cast(digits2_i(value)[1]); +} + // Formats a decimal unsigned integer value writing to out pointing to a buffer // of specified size. The caller must ensure that the buffer is large enough. template @@ -1221,12 +1230,19 @@ FMT_CONSTEXPR20 auto do_format_decimal(Char* out, UInt value, int size) FMT_ASSERT(size >= count_digits(value), "invalid digit count"); unsigned n = to_unsigned(size); while (value >= 100) { - // Integer division is slow so do it for a group of two digits instead - // of for every digit. The idea comes from the talk by Alexandrescu - // "Three Optimization Tips for C++". See speed-test for a comparison. n -= 2; - write2digits(out + n, static_cast(value % 100)); - value /= 100; + if (!is_constant_evaluated() && sizeof(UInt) == 4) { + auto p = value * static_cast((1ull << 39) / 100 + 1); + write2digits_i(out + n, p >> (39 - 7) & ((1 << 7) - 1)); + value = static_cast(p >> 39) + + (static_cast(value >= (100u << 25)) << 25); + } else { + // Integer division is slow so do it for a group of two digits instead + // of for every digit. The idea comes from the talk by Alexandrescu + // "Three Optimization Tips for C++". See speed-test for a comparison. + write2digits(out + n, static_cast(value % 100)); + value /= 100; + } } if (value >= 10) { n -= 2; @@ -1311,7 +1327,13 @@ class utf8_to_utf16 { inline auto str() const -> std::wstring { return {&buffer_[0], size()}; } }; -enum class to_utf8_error_policy { abort, replace }; +enum class to_utf8_error_policy { abort, replace, wtf }; + +inline void to_utf8_3bytes(buffer& buf, uint32_t cp) { + buf.push_back(static_cast(0xe0 | (cp >> 12))); + buf.push_back(static_cast(0x80 | ((cp & 0xfff) >> 6))); + buf.push_back(static_cast(0x80 | (cp & 0x3f))); +} // A converter from UTF-16/UTF-32 (host endian) to UTF-8. template class to_utf8 { @@ -1353,8 +1375,13 @@ template class to_utf8 { // Handle a surrogate pair. ++p; if (p == s.end() || (c & 0xfc00) != 0xd800 || (*p & 0xfc00) != 0xdc00) { - if (policy == to_utf8_error_policy::abort) return false; - buf.append(string_view("\xEF\xBF\xBD")); + switch (policy) { + case to_utf8_error_policy::abort: return false; + case to_utf8_error_policy::replace: + buf.append(string_view("\xEF\xBF\xBD")); + break; + case to_utf8_error_policy::wtf: to_utf8_3bytes(buf, c); break; + } --p; continue; } @@ -1366,9 +1393,7 @@ template class to_utf8 { buf.push_back(static_cast(0xc0 | (c >> 6))); buf.push_back(static_cast(0x80 | (c & 0x3f))); } else if ((c >= 0x800 && c <= 0xd7ff) || (c >= 0xe000 && c <= 0xffff)) { - buf.push_back(static_cast(0xe0 | (c >> 12))); - buf.push_back(static_cast(0x80 | ((c & 0xfff) >> 6))); - buf.push_back(static_cast(0x80 | (c & 0x3f))); + to_utf8_3bytes(buf, c); } else if (c >= 0x10000 && c <= 0x10ffff) { buf.push_back(static_cast(0xf0 | (c >> 18))); buf.push_back(static_cast(0x80 | ((c & 0x3ffff) >> 12))); @@ -1383,11 +1408,11 @@ template class to_utf8 { }; // Computes 128-bit result of multiplication of two 64-bit unsigned integers. -FMT_INLINE auto umul128(uint64_t x, uint64_t y) noexcept -> uint128_fallback { +FMT_INLINE auto umul128(uint64_t x, uint64_t y) noexcept -> uint128 { #if FMT_USE_INT128 - auto p = static_cast(x) * static_cast(y); + auto p = static_cast(x) * static_cast(y); return {static_cast(p >> 64), static_cast(p)}; -#elif defined(_MSC_VER) && defined(_M_X64) +#elif defined(_MSC_VER) && defined(_M_AMD64) auto hi = uint64_t(); auto lo = _umul128(x, y, &hi); return {hi, lo}; @@ -1428,9 +1453,9 @@ inline auto floor_log2_pow10(int e) noexcept -> int { // Computes upper 64 bits of multiplication of two 64-bit unsigned integers. inline auto umul128_upper64(uint64_t x, uint64_t y) noexcept -> uint64_t { #if FMT_USE_INT128 - auto p = static_cast(x) * static_cast(y); + auto p = static_cast(x) * static_cast(y); return static_cast(p >> 64); -#elif defined(_MSC_VER) && defined(_M_X64) +#elif defined(_MSC_VER) && defined(_M_AMD64) return __umulh(x, y); #else return umul128(x, y).high(); @@ -1439,40 +1464,39 @@ inline auto umul128_upper64(uint64_t x, uint64_t y) noexcept -> uint64_t { // Computes upper 128 bits of multiplication of a 64-bit unsigned integer and a // 128-bit unsigned integer. -inline auto umul192_upper128(uint64_t x, uint128_fallback y) noexcept - -> uint128_fallback { - uint128_fallback r = umul128(x, y.high()); +inline auto umul192_upper128(uint64_t x, uint128 y) noexcept -> uint128 { + uint128 r = umul128(x, y.high()); r += umul128_upper64(x, y.low()); return r; } -FMT_API auto get_cached_power(int k) noexcept -> uint128_fallback; +FMT_API auto get_cached_power(int k) noexcept -> uint128; // Type-specific information that Dragonbox uses. template struct float_info; template <> struct float_info { using carrier_uint = uint32_t; - static const int exponent_bits = 8; - static const int kappa = 1; - static const int big_divisor = 100; - static const int small_divisor = 10; - static const int min_k = -31; - static const int max_k = 46; - static const int shorter_interval_tie_lower_threshold = -35; - static const int shorter_interval_tie_upper_threshold = -35; + static constexpr int exponent_bits = 8; + static constexpr int kappa = 1; + static constexpr int big_divisor = 100; + static constexpr int small_divisor = 10; + static constexpr int min_k = -31; + enum { max_k = 46 }; + static constexpr int shorter_interval_tie_lower_threshold = -35; + static constexpr int shorter_interval_tie_upper_threshold = -35; }; template <> struct float_info { using carrier_uint = uint64_t; - static const int exponent_bits = 11; - static const int kappa = 2; - static const int big_divisor = 1000; - static const int small_divisor = 100; - static const int min_k = -292; - static const int max_k = 341; - static const int shorter_interval_tie_lower_threshold = -77; - static const int shorter_interval_tie_upper_threshold = -77; + static constexpr int exponent_bits = 11; + static constexpr int kappa = 2; + static constexpr int big_divisor = 1000; + static constexpr int small_divisor = 100; + static constexpr int min_k = -292; + enum { max_k = 341 }; + static constexpr int shorter_interval_tie_lower_threshold = -77; + static constexpr int shorter_interval_tie_upper_threshold = -77; }; // An 80- or 128-bit floating point number. @@ -1608,7 +1632,7 @@ template struct basic_fp { } }; -using fp = basic_fp; +using fp = basic_fp; // Normalizes the value converted from double and multiplied by (1 << SHIFT). template @@ -1739,7 +1763,7 @@ FMT_API auto is_printable(uint32_t cp) -> bool; inline auto needs_escape(uint32_t cp) -> bool { if (cp < 0x20 || cp == 0x7f || cp == '"' || cp == '\\') return true; - if (const_check(FMT_OPTIMIZE_SIZE > 1)) return false; + if FMT_CONSTEXPR20 (FMT_OPTIMIZE_SIZE > 1) return false; return !is_printable(cp); } @@ -1754,7 +1778,7 @@ auto find_escape(const Char* begin, const Char* end) -> find_escape_result { for (; begin != end; ++begin) { uint32_t cp = static_cast>(*begin); - if (const_check(sizeof(Char) == 1) && cp >= 0x80) continue; + if (sizeof(Char) == 1 && cp >= 0x80) continue; if (needs_escape(cp)) return {begin, begin + 1, cp}; } return {begin, nullptr, 0}; @@ -1762,7 +1786,7 @@ auto find_escape(const Char* begin, const Char* end) inline auto find_escape(const char* begin, const char* end) -> find_escape_result { - if (const_check(!use_utf8)) return find_escape(begin, end); + if FMT_CONSTEXPR20 (!use_utf8) return find_escape(begin, end); auto result = find_escape_result{end, nullptr, 0}; for_each_codepoint(string_view(begin, to_unsigned(end - begin)), [&](uint32_t cp, string_view sv) { @@ -1890,7 +1914,7 @@ template class digit_grouping { explicit digit_grouping(locale_ref loc, bool localized = true) { if (!localized) return; auto sep = thousands_sep(loc); - grouping_ = sep.grouping; + grouping_ = std::move(sep.grouping); if (sep.thousands_sep) thousands_sep_.assign(1, sep.thousands_sep); } digit_grouping(std::string grouping, std::basic_string sep) @@ -2335,9 +2359,8 @@ FMT_CONSTEXPR auto parse_align(const Char* begin, const Char* end, ++begin; } break; - } else if (p == begin) { - break; } + if (p == begin) break; p = begin; } specs.set_align(alignment); @@ -2534,7 +2557,7 @@ FMT_CONSTEXPR20 auto write_fixed(OutputIt out, const DecimalFP& f, auto grouping = Grouping(loc, specs.localized()); size += grouping.count_separators(exp); return write_padded( - out, specs, to_unsigned(size), [&](iterator it) { + out, specs, static_cast(size), [&](iterator it) { if (s != sign::none) *it++ = detail::getsign(s); it = write_significand(it, f.significand, significand_size, exp, decimal_point, grouping); @@ -2550,7 +2573,7 @@ FMT_CONSTEXPR20 auto write_fixed(OutputIt out, const DecimalFP& f, bool pointy = num_zeros != 0 || significand_size != 0 || specs.alt(); size += 1 + (pointy ? 1 : 0) + num_zeros; return write_padded( - out, specs, to_unsigned(size), [&](iterator it) { + out, specs, static_cast(size), [&](iterator it) { if (s != sign::none) *it++ = detail::getsign(s); *it++ = Char('0'); if (!pointy) return it; @@ -2594,7 +2617,7 @@ FMT_CONSTEXPR20 auto do_write_float(OutputIt out, const DecimalFP& f, *it++ = Char(exp_char); return write_exponent(exp, it); }; - auto usize = to_unsigned(size); + size_t usize = static_cast(size); return specs.width > 0 ? write_padded(out, specs, usize, write) : base_iterator(out, write(reserve(out, usize))); @@ -3138,8 +3161,9 @@ constexpr auto fractional_part_rounding_thresholds(int index) -> uint32_t { // It is equal to ceil(2^31 + 2^32/10^(k + 1)). // These are stored in a string literal because we cannot have static arrays // in constexpr functions and non-static ones are poorly optimized. - return U"\x9999999a\x828f5c29\x80418938\x80068db9\x8000a7c6\x800010c7" - U"\x800001ae\x8000002b"[index]; + return uint32_t(u"\x9999\x828f\x8041\x8006\x8000\x8000\x8000\x8000"[index]) + << 16u | + uint32_t(u"\x999a\x5c29\x8938\x8db9\xa7c6\x10c7\x01ae\x002b"[index]); } template @@ -3544,8 +3568,8 @@ FMT_CONSTEXPR20 auto write(OutputIt out, T value) -> OutputIt { memcpy(ptr, prefix, 2); ptr += 2; } else { - *ptr++ = prefix[0]; - *ptr++ = prefix[1]; + *ptr++ = static_cast(prefix[0]); + *ptr++ = static_cast(prefix[1]); } if (abs_exponent >= 100) { *ptr++ = static_cast('0' + abs_exponent / 100); @@ -3697,12 +3721,12 @@ template struct arg_formatter { struct dynamic_spec_getter { template ::value)> - FMT_CONSTEXPR auto operator()(T value) -> unsigned long long { - return is_negative(value) ? ~0ull : static_cast(value); + FMT_CONSTEXPR auto operator()(T value) -> ullong { + return is_negative(value) ? ~0ull : static_cast(value); } template ::value)> - FMT_CONSTEXPR auto operator()(T) -> unsigned long long { + FMT_CONSTEXPR auto operator()(T) -> ullong { report_error("width/precision is not integer"); return 0; } @@ -3716,7 +3740,7 @@ FMT_CONSTEXPR void handle_dynamic_spec( auto arg = kind == arg_id_kind::index ? ctx.arg(ref.index) : ctx.arg(ref.name); if (!arg) report_error("argument not found"); - unsigned long long result = arg.visit(dynamic_spec_getter()); + ullong result = arg.visit(dynamic_spec_getter()); if (result > to_unsigned(max_value())) report_error("width/precision is out of range"); value = static_cast(result); @@ -3751,7 +3775,7 @@ struct udl_arg { template struct udl_arg { const Char* str; - template auto operator=(T&& value) const -> named_arg { + template auto operator=(T&& value) const -> named_arg { return {str, std::forward(value)}; } }; @@ -3864,7 +3888,7 @@ template class generic_context { constexpr auto out() const -> iterator { return out_; } - void advance_to(iterator it) { + FMT_CONSTEXPR void advance_to(iterator it) { if (!detail::is_back_insert_iterator()) out_ = it; } @@ -3906,8 +3930,8 @@ template class format_facet : public Locale::facet { explicit format_facet(string_view sep = "", std::string grouping = "\3", std::string decimal_point = ".") : separator_(sep.data(), sep.size()), - grouping_(grouping), - decimal_point_(decimal_point) {} + grouping_(std::move(grouping)), + decimal_point_(std::move(decimal_point)) {} auto put(appender out, loc_value val, const format_specs& specs) const -> bool { @@ -3943,12 +3967,6 @@ template class formatter, Char> : public formatter, Char> {}; -template -struct formatter, Char> : formatter {}; -template -struct formatter, Char> - : formatter {}; - template struct formatter : detail::native_formatter underlying_t { } } // namespace enums -#ifdef __cpp_lib_byte -template -struct formatter : formatter { - static auto format_as(std::byte b) -> unsigned char { - return static_cast(b); - } - template - auto format(std::byte b, Context& ctx) const -> decltype(ctx.out()) { - return formatter::format(format_as(b), ctx); - } -}; -#endif - struct bytes { string_view data; @@ -4142,6 +4147,14 @@ template struct nested_formatter { inline namespace literals { #if FMT_USE_NONTYPE_TEMPLATE_ARGS +/** + * User-defined literal equivalent of `fmt::arg`, but with compile-time checks. + * + * **Example**: + * + * using namespace fmt::literals; + * fmt::print("The answer is {answer}.", "answer"_a=42); + */ template constexpr auto operator""_a() { using char_t = remove_cvref_t; return detail::udl_arg(); @@ -4166,7 +4179,7 @@ class format_int { private: // Buffer should be large enough to hold all digits (digits10 + 1), // a sign and a null character. - enum { buffer_size = std::numeric_limits::digits10 + 3 }; + enum { buffer_size = std::numeric_limits::digits10 + 3 }; mutable char buffer_[buffer_size]; char* str_; @@ -4196,7 +4209,7 @@ class format_int { : str_(format_unsigned(value)) {} FMT_CONSTEXPR20 explicit format_int(unsigned long value) : str_(format_unsigned(value)) {} - FMT_CONSTEXPR20 explicit format_int(unsigned long long value) + FMT_CONSTEXPR20 explicit format_int(ullong value) : str_(format_unsigned(value)) {} /// Returns the number of characters written to the output buffer. @@ -4248,7 +4261,11 @@ class format_int { * // A compile-time error because 'd' is an invalid specifier for strings. * std::string s = fmt::format(FMT_STRING("{:d}"), "foo"); */ -#define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string) +#if FMT_USE_CONSTEVAL +# define FMT_STRING(s) s +#else +# define FMT_STRING(s) FMT_STRING_IMPL(s, fmt::detail::compile_string) +#endif // FMT_USE_CONSTEVAL FMT_API auto vsystem_error(int error_code, string_view fmt, format_args args) -> std::system_error; diff --git a/dep/fmt/include/fmt/os.h b/dep/fmt/include/fmt/os.h index 94d730de2..a3ee58f34 100644 --- a/dep/fmt/include/fmt/os.h +++ b/dep/fmt/include/fmt/os.h @@ -1,6 +1,6 @@ // Formatting library for C++ - optional OS-specific functionality // -// Copyright (c) 2012 - present, Victor Zverovich +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -161,14 +161,6 @@ inline auto system_category() noexcept -> const std::error_category& { } #endif // _WIN32 -// std::system is not available on some platforms such as iOS (#2248). -#ifdef __OSX__ -template > -void say(const S& fmt, Args&&... args) { - std::system(format("say \"{}\"", format(fmt, args...)).c_str()); -} -#endif - // A buffered file. class buffered_file { private: diff --git a/dep/fmt/include/fmt/ostream.h b/dep/fmt/include/fmt/ostream.h index bf2371b79..da9c65e04 100644 --- a/dep/fmt/include/fmt/ostream.h +++ b/dep/fmt/include/fmt/ostream.h @@ -1,6 +1,6 @@ // Formatting library for C++ - std::ostream support // -// Copyright (c) 2012 - present, Victor Zverovich +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -38,7 +38,7 @@ namespace detail { namespace { struct file_access_tag {}; } // namespace -template +template class file_access { friend auto get_file(BufType& obj) -> FILE* { return obj.*FileMemberPtr; } }; @@ -150,7 +150,7 @@ inline void vprint(std::ostream& os, string_view fmt, format_args args) { FMT_EXPORT template void print(std::ostream& os, format_string fmt, T&&... args) { fmt::vargs vargs = {{args...}}; - if (detail::const_check(detail::use_utf8)) return vprint(os, fmt.str, vargs); + if FMT_CONSTEXPR20 (detail::use_utf8) return vprint(os, fmt.str, vargs); auto buffer = memory_buffer(); detail::vformat_to(buffer, fmt.str, vargs); detail::write_buffer(os, buffer); diff --git a/dep/fmt/include/fmt/printf.h b/dep/fmt/include/fmt/printf.h index cc066d8c0..8d792fbde 100644 --- a/dep/fmt/include/fmt/printf.h +++ b/dep/fmt/include/fmt/printf.h @@ -1,6 +1,6 @@ // Formatting library for C++ - legacy printf implementation // -// Copyright (c) 2012 - 2016, Victor Zverovich +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -136,7 +136,7 @@ template class arg_converter { void operator()(U value) { bool is_signed = type_ == 'd' || type_ == 'i'; using target_type = conditional_t::value, U, T>; - if (const_check(sizeof(target_type) <= sizeof(int))) { + if FMT_CONSTEXPR20 (sizeof(target_type) <= sizeof(int)) { // Extra casts are used to silence warnings. using unsigned_type = typename make_unsigned_or_bool::type; if (is_signed) @@ -330,6 +330,7 @@ template auto parse_header(const Char*& it, const Char* end, format_specs& specs, GetArg get_arg) -> int { int arg_index = -1; + if (it == end) return arg_index; Char c = *it; if (c >= '0' && c <= '9') { // Parse an argument index (if followed by '$') or a width possibly @@ -357,8 +358,21 @@ auto parse_header(const Char*& it, const Char* end, format_specs& specs, if (specs.width == -1) report_error("number is too big"); } else if (*it == '*') { ++it; - specs.width = static_cast( - get_arg(-1).visit(detail::printf_width_handler(specs))); + // Check for positional width argument like *1$ + if (it != end && *it >= '0' && *it <= '9') { + int width_index = parse_nonnegative_int(it, end, -1); + if (it != end && *it == '$') { + ++it; + specs.width = static_cast( + get_arg(width_index).visit(detail::printf_width_handler(specs))); + } else { + // Invalid format, rewind and treat as non-positional + report_error("invalid format specifier"); + } + } else { + specs.width = static_cast( + get_arg(-1).visit(detail::printf_width_handler(specs))); + } } } return arg_index; @@ -424,6 +438,8 @@ void vprintf(buffer& buf, basic_string_view format, } write(out, basic_string_view(start, to_unsigned(it - 1 - start))); + if (it == end) report_error("invalid format string"); + auto specs = format_specs(); specs.set_align(align::right); @@ -439,15 +455,28 @@ void vprintf(buffer& buf, basic_string_view format, specs.precision = parse_nonnegative_int(it, end, 0); } else if (c == '*') { ++it; - specs.precision = - static_cast(get_arg(-1).visit(printf_precision_handler())); + // Check for positional precision argument like .*1$ + if (it != end && *it >= '0' && *it <= '9') { + int precision_index = parse_nonnegative_int(it, end, -1); + if (it != end && *it == '$') { + ++it; + specs.precision = static_cast( + get_arg(precision_index).visit(printf_precision_handler())); + } else { + // Invalid format, rewind and treat as non-positional + report_error("invalid format specifier"); + } + } else { + specs.precision = + static_cast(get_arg(-1).visit(printf_precision_handler())); + } } else { specs.precision = 0; } } auto arg = get_arg(arg_index); - // For d, i, o, u, x, and X conversion specifiers, if a precision is + // For d, i, o, u, x and X conversion specifiers, if a precision is // specified, the '0' flag is ignored if (specs.precision >= 0 && is_integral_type(arg.type())) { // Ignore '0' for non-numeric types or if '-' present. @@ -560,7 +589,7 @@ inline auto vsprintf(basic_string_view fmt, /** * Formats `args` according to specifications in `fmt` and returns the result - * as as string. + * as string. * * **Example**: * diff --git a/dep/fmt/include/fmt/ranges.h b/dep/fmt/include/fmt/ranges.h index 36b38e296..99bef8417 100644 --- a/dep/fmt/include/fmt/ranges.h +++ b/dep/fmt/include/fmt/ranges.h @@ -69,11 +69,12 @@ struct has_member_fn_begin_end_t().begin()), // Member function overloads. template -auto range_begin(T&& rng) -> decltype(static_cast(rng).begin()) { +FMT_CONSTEXPR auto range_begin(T&& rng) + -> decltype(static_cast(rng).begin()) { return static_cast(rng).begin(); } template -auto range_end(T&& rng) -> decltype(static_cast(rng).end()) { +FMT_CONSTEXPR auto range_end(T&& rng) -> decltype(static_cast(rng).end()) { return static_cast(rng).end(); } @@ -129,6 +130,13 @@ template class is_tuple_like_ { !std::is_void(nullptr))>::value; }; +template +struct is_optional_like_ : std::false_type {}; +template +struct is_optional_like_().has_value()), + decltype(std::declval().value())>> + : std::true_type {}; + // Check for integer_sequence #if defined(__cpp_lib_integer_sequence) || FMT_MSC_VERSION >= 1900 template @@ -343,8 +351,9 @@ struct formatter struct is_range { - static constexpr bool value = - detail::is_range_::value && !detail::has_to_string_view::value; + static constexpr bool value = detail::is_range_::value && + !detail::is_optional_like_::value && + !detail::has_to_string_view::value; }; namespace detail { @@ -460,7 +469,8 @@ struct range_formatter< } template - auto format(R&& range, FormatContext& ctx) const -> decltype(ctx.out()) { + FMT_CONSTEXPR auto format(R&& range, FormatContext& ctx) const + -> decltype(ctx.out()) { auto out = ctx.out(); auto it = detail::range_begin(range); auto end = detail::range_end(range); @@ -505,8 +515,7 @@ struct formatter< using nonlocking = void; FMT_CONSTEXPR formatter() { - if (detail::const_check(range_format_kind::value != - range_format::set)) + if FMT_CONSTEXPR20 (range_format_kind::value != range_format::set) return; range_formatter_.set_brackets(detail::string_literal{}, detail::string_literal{}); @@ -517,7 +526,7 @@ struct formatter< } template - auto format(range_type& range, FormatContext& ctx) const + FMT_CONSTEXPR auto format(range_type& range, FormatContext& ctx) const -> decltype(ctx.out()) { return range_formatter_.format(range, ctx); } @@ -607,13 +616,14 @@ struct formatter< auto format(range_type& range, FormatContext& ctx) const -> decltype(ctx.out()) { auto out = ctx.out(); - if (detail::const_check(range_format_kind::value == - range_format::debug_string)) + if FMT_CONSTEXPR20 (range_format_kind::value == + range_format::debug_string) { *out++ = '"'; + } out = underlying_.format( string_type{detail::range_begin(range), detail::range_end(range)}, ctx); - if (detail::const_check(range_format_kind::value == - range_format::debug_string)) + if FMT_CONSTEXPR20 (range_format_kind::value == + range_format::debug_string) *out++ = '"'; return out; } @@ -625,7 +635,7 @@ struct join_view : detail::view { Sentinel end; basic_string_view sep; - join_view(It b, Sentinel e, basic_string_view s) + FMT_CONSTEXPR join_view(It b, Sentinel e, basic_string_view s) : begin(std::move(b)), end(e), sep(s) {} }; @@ -652,7 +662,8 @@ struct formatter, Char> { } template - auto format(view& value, FormatContext& ctx) const -> decltype(ctx.out()) { + FMT_CONSTEXPR auto format(view& value, FormatContext& ctx) const + -> decltype(ctx.out()) { using iter = conditional_t::value, It, It&>; iter it = value.begin; @@ -675,7 +686,7 @@ template struct tuple_join_view : detail::view { const Tuple& tuple; basic_string_view sep; - tuple_join_view(const Tuple& t, basic_string_view s) + FMT_CONSTEXPR tuple_join_view(const Tuple& t, basic_string_view s) : tuple(t), sep{s} {} }; @@ -694,8 +705,9 @@ struct formatter, Char, } template - auto format(const tuple_join_view& value, - FormatContext& ctx) const -> typename FormatContext::iterator { + FMT_CONSTEXPR auto format(const tuple_join_view& value, + FormatContext& ctx) const -> + typename FormatContext::iterator { return do_format(value, ctx, std::tuple_size()); } @@ -726,15 +738,17 @@ struct formatter, Char, } template - auto do_format(const tuple_join_view&, FormatContext& ctx, - std::integral_constant) const -> + FMT_CONSTEXPR auto do_format(const tuple_join_view&, + FormatContext& ctx, + std::integral_constant) const -> typename FormatContext::iterator { return ctx.out(); } template - auto do_format(const tuple_join_view& value, FormatContext& ctx, - std::integral_constant) const -> + FMT_CONSTEXPR auto do_format(const tuple_join_view& value, + FormatContext& ctx, + std::integral_constant) const -> typename FormatContext::iterator { using std::get; auto out = @@ -748,9 +762,20 @@ struct formatter, Char, }; namespace detail { -// Check if T has an interface like a container adaptor (e.g. std::stack, -// std::queue, std::priority_queue). -template class is_container_adaptor_like { +template struct all { + const Container& c; + auto begin() const -> typename Container::const_iterator { return c.begin(); } + auto end() const -> typename Container::const_iterator { return c.end(); } +}; +} // namespace detail + +/** + * Specifies if `T` is a container adaptor (like `std::stack`) that should be + * formatted as the underlying container. + */ +FMT_EXPORT +template struct is_container_adaptor { + private: template static auto check(U* p) -> typename U::container_type; template static void check(...); @@ -759,17 +784,10 @@ template class is_container_adaptor_like { !std::is_void(nullptr))>::value; }; -template struct all { - const Container& c; - auto begin() const -> typename Container::const_iterator { return c.begin(); } - auto end() const -> typename Container::const_iterator { return c.end(); } -}; -} // namespace detail - template struct formatter< T, Char, - enable_if_t, + enable_if_t, bool_constant::value == range_format::disabled>>::value>> : formatter, Char> { @@ -809,7 +827,7 @@ auto join(It begin, Sentinel end, string_view sep) -> join_view { * // Output: 01, 02, 03 */ template ::value)> -auto join(Range&& r, string_view sep) +FMT_CONSTEXPR auto join(Range&& r, string_view sep) -> join_view { return {detail::range_begin(r), detail::range_end(r), sep}; @@ -840,7 +858,7 @@ FMT_CONSTEXPR auto join(const Tuple& tuple FMT_LIFETIMEBOUND, string_view sep) * // Output: "1, 2, 3" */ template -auto join(std::initializer_list list, string_view sep) +FMT_DEPRECATED auto join(std::initializer_list list, string_view sep) -> join_view { return join(std::begin(list), std::end(list), sep); } diff --git a/dep/fmt/include/fmt/std.h b/dep/fmt/include/fmt/std.h index 184c6d26d..f7d8d4956 100644 --- a/dep/fmt/include/fmt/std.h +++ b/dep/fmt/include/fmt/std.h @@ -1,6 +1,6 @@ // Formatting library for C++ - formatters for standard library types // -// Copyright (c) 2012 - present, Victor Zverovich +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -15,7 +15,8 @@ # include # include # include -# include +# include // std::byte +# include // std::exception # include // std::reference_wrapper # include # include @@ -79,15 +80,34 @@ FMT_BEGIN_NAMESPACE namespace detail { +#ifdef FMT_USE_BITINT +// Use the provided definition. +#elif FMT_CLANG_VERSION >= 1500 && !defined(__CUDACC__) +# define FMT_USE_BITINT 1 +#else +# define FMT_USE_BITINT 0 +#endif + +#if FMT_USE_BITINT +FMT_PRAGMA_CLANG(diagnostic ignored "-Wbit-int-extension") +template using bitint = _BitInt(N); +template using ubitint = unsigned _BitInt(N); +#else +template struct bitint {}; +template struct ubitint {}; +#endif // FMT_USE_BITINT + #if FMT_CPP_LIB_FILESYSTEM template auto get_path_string(const std::filesystem::path& p, const std::basic_string& native) { - if constexpr (std::is_same_v && std::is_same_v) - return to_utf8(native, to_utf8_error_policy::replace); - else + if constexpr (std::is_same_v && + std::is_same_v) { + return to_utf8(native, to_utf8_error_policy::wtf); + } else { return p.string(); + } } template @@ -113,8 +133,8 @@ void write_escaped_path(basic_memory_buffer& quoted, #if defined(__cpp_lib_expected) || FMT_CPP_LIB_VARIANT template -auto write_escaped_alternative(OutputIt out, const T& v, FormatContext& ctx) - -> OutputIt { +FMT_CONSTEXPR auto write_escaped_alternative(OutputIt out, const T& v, + FormatContext& ctx) -> OutputIt { if constexpr (has_to_string_view::value) return write_escaped_string(out, detail::to_string_view(v)); if constexpr (std::is_same_v) return write_escaped_char(out, v); @@ -434,6 +454,26 @@ struct formatter, Char, return out; } }; + +template +struct formatter, Char, + std::enable_if_t::value>> { + FMT_CONSTEXPR auto parse(parse_context& ctx) -> const Char* { + return ctx.begin(); + } + + template + auto format(const std::unexpected& value, FormatContext& ctx) const + -> decltype(ctx.out()) { + auto out = ctx.out(); + + out = detail::write(out, "unexpected("); + out = detail::write_escaped_alternative(out, value.error(), ctx); + + *out++ = ')'; + return out; + } +}; #endif // __cpp_lib_expected #ifdef __cpp_lib_source_location @@ -468,7 +508,7 @@ template struct formatter { } template - auto format(const std::monostate&, FormatContext& ctx) const + FMT_CONSTEXPR auto format(const std::monostate&, FormatContext& ctx) const -> decltype(ctx.out()) { return detail::write(ctx.out(), "monostate"); } @@ -484,7 +524,7 @@ struct formatter - auto format(const Variant& value, FormatContext& ctx) const + FMT_CONSTEXPR20 auto format(const Variant& value, FormatContext& ctx) const -> decltype(ctx.out()) { auto out = ctx.out(); @@ -609,6 +649,30 @@ struct formatter< } }; +template +struct formatter, Char> : formatter { + static_assert(N <= 64, "unsupported _BitInt"); + static auto format_as(detail::bitint x) -> long long { + return static_cast(x); + } + template + auto format(detail::bitint x, Context& ctx) const -> decltype(ctx.out()) { + return formatter::format(format_as(x), ctx); + } +}; + +template +struct formatter, Char> : formatter { + static_assert(N <= 64, "unsupported _BitInt"); + static auto format_as(detail::ubitint x) -> ullong { + return static_cast(x); + } + template + auto format(detail::ubitint x, Context& ctx) const -> decltype(ctx.out()) { + return formatter::format(format_as(x), ctx); + } +}; + // We can't use std::vector::reference and // std::bitset::reference because the compiler can't deduce Allocator and N // in partial specialization. @@ -623,6 +687,20 @@ struct formatter +struct formatter : formatter { + FMT_CONSTEXPR static auto format_as(std::byte b) -> unsigned char { + return static_cast(b); + } + template + FMT_CONSTEXPR auto format(std::byte b, Context& ctx) const + -> decltype(ctx.out()) { + return formatter::format(format_as(b), ctx); + } +}; +#endif + template struct formatter, Char, enable_if_t::value>> @@ -645,6 +723,11 @@ struct formatter : formatter { }; #endif // __cpp_lib_atomic_flag_test +template struct is_tuple_like; + +template +struct is_tuple_like> : std::false_type {}; + template struct formatter, Char> { private: detail::dynamic_format_specs specs_; diff --git a/dep/fmt/include/fmt/xchar.h b/dep/fmt/include/fmt/xchar.h index 9334b87fd..9631372a1 100644 --- a/dep/fmt/include/fmt/xchar.h +++ b/dep/fmt/include/fmt/xchar.h @@ -1,6 +1,6 @@ // Formatting library for C++ - optional wchar_t and exotic character support // -// Copyright (c) 2012 - present, Victor Zverovich +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -109,7 +109,7 @@ template struct basic_fstring { } basic_fstring(runtime_format_string fmt) : str_(fmt.str) {} - operator basic_string_view() const { return str_; } + FMT_DEPRECATED operator basic_string_view() const { return str_; } auto get() const -> basic_string_view { return str_; } }; @@ -136,29 +136,42 @@ inline auto operator""_a(const wchar_t* s, size_t) -> detail::udl_arg { } // namespace literals #endif -template -auto join(It begin, Sentinel end, wstring_view sep) - -> join_view { - return {begin, end, sep}; +template +auto arg(const wchar_t* name, const T& arg) -> named_arg { + return {name, arg}; +} + +template ()))::value_type, + FMT_ENABLE_IF(detail::is_exotic_char::value)> +auto join(It begin, Sentinel end, S&& sep) -> join_view { + return {begin, end, detail::to_string_view(sep)}; } -template ::value)> -auto join(Range&& range, wstring_view sep) - -> join_view { - return join(std::begin(range), std::end(range), sep); +template ()))::value_type, + FMT_ENABLE_IF(detail::is_exotic_char::value && + !is_tuple_like::value)> +auto join(Range&& range, S&& sep) + -> join_view { + return {std::begin(range), std::end(range), detail::to_string_view(sep)}; } template -auto join(std::initializer_list list, wstring_view sep) +FMT_DEPRECATED auto join(std::initializer_list list, wstring_view sep) -> join_view { return join(std::begin(list), std::end(list), sep); } -template ::value)> -auto join(const Tuple& tuple, basic_string_view sep) - -> tuple_join_view { - return {tuple, sep}; +template ()))::value_type, + FMT_ENABLE_IF(detail::is_exotic_char::value&& + is_tuple_like::value)> +auto join(const Tuple& tuple, S&& sep) -> tuple_join_view { + return {tuple, detail::to_string_view(sep)}; } template ::value)> @@ -172,14 +185,13 @@ auto vformat(basic_string_view fmt, template auto format(wformat_string fmt, T&&... args) -> std::wstring { - return vformat(fmt::wstring_view(fmt), fmt::make_wformat_args(args...)); + return vformat(fmt.get(), fmt::make_wformat_args(args...)); } template auto format_to(OutputIt out, wformat_string fmt, T&&... args) -> OutputIt { - return vformat_to(out, fmt::wstring_view(fmt), - fmt::make_wformat_args(args...)); + return vformat_to(out, fmt.get(), fmt::make_wformat_args(args...)); } // Pass char_t as a default template parameter instead of using @@ -267,10 +279,18 @@ inline auto vformat_to_n(OutputIt out, size_t n, basic_string_view fmt, return {buf.out(), buf.count()}; } +template ::value)> +FMT_INLINE auto format_to_n(OutputIt out, size_t n, wformat_string fmt, + T&&... args) -> format_to_n_result { + return vformat_to_n(out, n, fmt.get(), fmt::make_wformat_args(args...)); +} + template , - FMT_ENABLE_IF(detail::is_output_iterator::value&& - detail::is_exotic_char::value)> + FMT_ENABLE_IF(detail::is_output_iterator::value && + !std::is_same::value && + !std::is_same::value)> inline auto format_to_n(OutputIt out, size_t n, const S& fmt, T&&... args) -> format_to_n_result { return vformat_to_n(out, n, fmt::basic_string_view(fmt), @@ -301,11 +321,11 @@ inline void vprint(wstring_view fmt, wformat_args args) { template void print(std::FILE* f, wformat_string fmt, T&&... args) { - return vprint(f, wstring_view(fmt), fmt::make_wformat_args(args...)); + return vprint(f, fmt.get(), fmt::make_wformat_args(args...)); } template void print(wformat_string fmt, T&&... args) { - return vprint(wstring_view(fmt), fmt::make_wformat_args(args...)); + return vprint(fmt.get(), fmt::make_wformat_args(args...)); } template @@ -327,7 +347,7 @@ inline auto vformat(text_style ts, wstring_view fmt, wformat_args args) template inline auto format(text_style ts, wformat_string fmt, T&&... args) -> std::wstring { - return fmt::vformat(ts, fmt, fmt::make_wformat_args(args...)); + return fmt::vformat(ts, fmt.get(), fmt::make_wformat_args(args...)); } inline void vprint(std::wostream& os, wstring_view fmt, wformat_args args) { @@ -338,7 +358,8 @@ inline void vprint(std::wostream& os, wstring_view fmt, wformat_args args) { template void print(std::wostream& os, wformat_string fmt, T&&... args) { - vprint(os, fmt, fmt::make_format_args>(args...)); + vprint(os, fmt.get(), + fmt::make_format_args>(args...)); } template diff --git a/dep/fmt/src/fmt-c.cc b/dep/fmt/src/fmt-c.cc new file mode 100644 index 000000000..d5945ea9b --- /dev/null +++ b/dep/fmt/src/fmt-c.cc @@ -0,0 +1,67 @@ +// Formatting library for C++ - the C API +// +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors +// All rights reserved. +// +// For the license information refer to format.h. + +#include "fmt/fmt-c.h" + +#include + +constexpr size_t max_c_format_args = 16; + +static int convert_c_format_args( + fmt::basic_format_arg* format_args, + const fmt_arg* args, size_t num_args) { + if (num_args > max_c_format_args) return fmt_error_invalid_arg; + + for (size_t i = 0; i < num_args; ++i) { + switch (args[i].type) { + case fmt_int: format_args[i] = args[i].value.int_value; break; + case fmt_uint: format_args[i] = args[i].value.uint_value; break; + case fmt_bool: format_args[i] = args[i].value.bool_value; break; + case fmt_char: format_args[i] = args[i].value.char_value; break; + case fmt_float: format_args[i] = args[i].value.float_value; break; + case fmt_double: format_args[i] = args[i].value.double_value; break; + case fmt_long_double: + format_args[i] = args[i].value.long_double_value; + break; + case fmt_cstring: format_args[i] = args[i].value.cstring; break; + case fmt_pointer: format_args[i] = args[i].value.pointer; break; + default: return fmt_error_invalid_arg; + } + } + return 0; +} + +extern "C" int fmt_vformat(char* buffer, size_t size, const char* fmt, + const fmt_arg* args, size_t num_args) { + fmt::basic_format_arg format_args[max_c_format_args]; + int error = convert_c_format_args(format_args, args, num_args); + if (error != 0) return error; + + FMT_TRY { + auto result = fmt::vformat_to_n( + buffer, size, fmt, + fmt::format_args(format_args, static_cast(num_args))); + return static_cast(result.size); + } + FMT_CATCH(...) {} + return fmt_error; +} + +extern "C" int fmt_vprint(FILE* stream, const char* fmt, const fmt_arg* args, + size_t num_args) { + fmt::basic_format_arg format_args[max_c_format_args]; + int error = convert_c_format_args(format_args, args, num_args); + if (error != 0) return error; + + FMT_TRY { + fmt::vprint(stream, fmt, + fmt::format_args(format_args, static_cast(num_args))); + return 0; + } + FMT_CATCH(...) {} + return fmt_error; +} diff --git a/dep/fmt/src/fmt.cc b/dep/fmt/src/fmt.cc index 0713da75c..f319ce947 100644 --- a/dep/fmt/src/fmt.cc +++ b/dep/fmt/src/fmt.cc @@ -1,3 +1,10 @@ +// Formatting library for C++ - C++20 module +// +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors +// All rights reserved. +// +// For the license information refer to format.h. + module; #define FMT_MODULE @@ -134,11 +141,6 @@ extern "C++" { } #endif -// gcc doesn't yet implement private module fragments -#if !FMT_GCC_VERSION -module :private; -#endif - #ifdef FMT_ATTACH_TO_GLOBAL_MODULE extern "C++" { #endif diff --git a/dep/fmt/src/format.cc b/dep/fmt/src/format.cc index 526082e34..298c5b4b9 100644 --- a/dep/fmt/src/format.cc +++ b/dep/fmt/src/format.cc @@ -1,6 +1,6 @@ // Formatting library for C++ // -// Copyright (c) 2012 - 2016, Victor Zverovich +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. diff --git a/dep/fmt/src/os.cc b/dep/fmt/src/os.cc index 4d7c299b8..4840a658f 100644 --- a/dep/fmt/src/os.cc +++ b/dep/fmt/src/os.cc @@ -1,6 +1,6 @@ // Formatting library for C++ - optional OS-specific functionality // -// Copyright (c) 2012 - 2016, Victor Zverovich +// Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. @@ -13,7 +13,6 @@ #include "fmt/os.h" #ifndef FMT_MODULE -# include # if FMT_USE_FCNTL # include @@ -35,6 +34,8 @@ # ifdef _WIN32 # include + +# include // CHAR_BIT # endif #endif @@ -61,6 +62,7 @@ namespace { #ifdef _WIN32 + // Return type of read and write functions. using rwresult = int; @@ -69,18 +71,6 @@ using rwresult = int; inline unsigned convert_rwcount(size_t count) { return count <= UINT_MAX ? static_cast(count) : UINT_MAX; } -#elif FMT_USE_FCNTL -// Return type of read and write functions. -using rwresult = ssize_t; - -inline auto convert_rwcount(size_t count) -> size_t { return count; } -#endif -} // namespace - -FMT_BEGIN_NAMESPACE - -#ifdef _WIN32 -namespace detail { class system_message { system_message(const system_message&) = delete; @@ -109,8 +99,8 @@ class system_message { } ~system_message() { LocalFree(message_); } explicit operator bool() const noexcept { return result_ != 0; } - operator basic_string_view() const noexcept { - return basic_string_view(message_, result_); + operator fmt::basic_string_view() const noexcept { + return fmt::basic_string_view(message_, result_); } }; @@ -120,7 +110,7 @@ class utf8_system_category final : public std::error_category { std::string message(int error_code) const override { auto&& msg = system_message(error_code); if (msg) { - auto utf8_message = to_utf8(); + auto utf8_message = fmt::detail::to_utf8(); if (utf8_message.convert(msg)) { return utf8_message.str(); } @@ -129,10 +119,22 @@ class utf8_system_category final : public std::error_category { } }; -} // namespace detail +#elif FMT_USE_FCNTL + +// Return type of read and write functions. +using rwresult = ssize_t; + +inline auto convert_rwcount(size_t count) -> size_t { return count; } + +#endif +} // namespace + +FMT_BEGIN_NAMESPACE + +#ifdef _WIN32 FMT_API const std::error_category& system_category() noexcept { - static const detail::utf8_system_category category; + static const utf8_system_category category; return category; } @@ -162,6 +164,7 @@ void detail::format_windows_error(detail::buffer& out, int error_code, void report_windows_error(int error_code, const char* message) noexcept { do_report_error(detail::format_windows_error, error_code, message); } + #endif // _WIN32 buffered_file::~buffered_file() noexcept { diff --git a/dep/fmt/support/cmake/FindSetEnv.cmake b/dep/fmt/support/cmake/FindSetEnv.cmake index 4e2da5408..8d3e2d492 100644 --- a/dep/fmt/support/cmake/FindSetEnv.cmake +++ b/dep/fmt/support/cmake/FindSetEnv.cmake @@ -1,7 +1,11 @@ # A CMake script to find SetEnv.cmd. -find_program(WINSDK_SETENV NAMES SetEnv.cmd - PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]/bin") +find_program( + WINSDK_SETENV + NAMES SetEnv.cmd + PATHS + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]/bin" +) if (WINSDK_SETENV AND PRINT_PATH) execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${WINSDK_SETENV}") endif () diff --git a/dep/fmt/support/cmake/JoinPaths.cmake b/dep/fmt/support/cmake/JoinPaths.cmake index 32d6d6685..ea36f68aa 100644 --- a/dep/fmt/support/cmake/JoinPaths.cmake +++ b/dep/fmt/support/cmake/JoinPaths.cmake @@ -1,26 +1,28 @@ -# This module provides function for joining paths -# known from from most languages +# This module provides function for joining paths known from from most languages # # Original license: # SPDX-License-Identifier: (MIT OR CC0-1.0) -# Explicit permission given to distribute this module under -# the terms of the project as described in /LICENSE.rst. +# Explicit permission given to distribute this module under the terms of the +# project as described in /LICENSE.md. # Copyright 2020 Jan Tojnar # https://github.com/jtojnar/cmake-snips # # Modelled after Python’s os.path.join # https://docs.python.org/3.7/library/os.path.html#os.path.join # Windows not supported -function(join_paths joined_path first_path_segment) - set(temp_path "${first_path_segment}") - foreach(current_segment IN LISTS ARGN) - if(NOT ("${current_segment}" STREQUAL "")) - if(IS_ABSOLUTE "${current_segment}") - set(temp_path "${current_segment}") - else() - set(temp_path "${temp_path}/${current_segment}") - endif() - endif() - endforeach() - set(${joined_path} "${temp_path}" PARENT_SCOPE) -endfunction() + +function (join_paths joined_path first_path_segment) + set(temp_path "${first_path_segment}") + foreach (current_segment IN LISTS ARGN) + if (NOT ("${current_segment}" STREQUAL "")) + if (IS_ABSOLUTE "${current_segment}") + set(temp_path "${current_segment}") + else () + set(temp_path "${temp_path}/${current_segment}") + endif () + endif () + endforeach () + set(${joined_path} + "${temp_path}" + PARENT_SCOPE) +endfunction ()