From 43dbd8cb57cf5badef7201cb833a9415930f1913 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 10 Sep 2023 07:13:01 +0100 Subject: [PATCH] Bump libfmt Hopefully we'll be able to get rid of the custom nxdk fork soon. --- 3rdParty/libfmt/CMakeLists.txt | 8 ++++++-- Source/dvlnet/tcp_client.h | 9 +++++++++ Source/dvlnet/tcp_server.h | 9 +++++++++ Source/platform/ctr/sockets.cpp | 6 ++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/3rdParty/libfmt/CMakeLists.txt b/3rdParty/libfmt/CMakeLists.txt index df2295fb7..23ad7fa8d 100644 --- a/3rdParty/libfmt/CMakeLists.txt +++ b/3rdParty/libfmt/CMakeLists.txt @@ -5,6 +5,10 @@ if(NOT WIN32 AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL FreeBSD) add_definitions(-D_POSIX_C_SOURCE=200809L) endif() +# Disable fmt/os.h functionality. +# We do not use it and it is not supported on some systems. +set(FMT_OS OFF) + if(DEVILUTIONX_STATIC_LIBFMT) set(BUILD_SHARED_LIBS OFF) else() @@ -19,8 +23,8 @@ if(NXDK) ) else() FetchContent_Declare(libfmt - URL https://github.com/fmtlib/fmt/archive/refs/tags/10.0.0.tar.gz - URL_HASH MD5=fa629bc1178918b7af4b2ea6b6a271dc + URL https://github.com/fmtlib/fmt/archive/refs/tags/10.1.1.tar.gz + URL_HASH MD5=0d41a16f1b3878d44e6fd7ff1f6cc45a ) endif() FetchContent_MakeAvailableExcludeFromAll(libfmt) diff --git a/Source/dvlnet/tcp_client.h b/Source/dvlnet/tcp_client.h index 8a06213e4..22b507678 100644 --- a/Source/dvlnet/tcp_client.h +++ b/Source/dvlnet/tcp_client.h @@ -3,6 +3,15 @@ #include #include +// This header must be included before any 3DS code +// because 3DS SDK defines a macro with the same name +// as an fmt template parameter in some versions of fmt. +// See https://github.com/fmtlib/fmt/issues/3632 +// +// 3DS uses some custom ASIO code that transitively includes +// the 3DS SDK. +#include + #include #include #include diff --git a/Source/dvlnet/tcp_server.h b/Source/dvlnet/tcp_server.h index d56fdce8c..c397081d6 100644 --- a/Source/dvlnet/tcp_server.h +++ b/Source/dvlnet/tcp_server.h @@ -4,6 +4,15 @@ #include #include +// This header must be included before any 3DS code +// because 3DS SDK defines a macro with the same name +// as an fmt template parameter in some versions of fmt. +// See https://github.com/fmtlib/fmt/issues/3632 +// +// 3DS uses some custom ASIO code that transitively includes +// the 3DS SDK. +#include + #include #include #include diff --git a/Source/platform/ctr/sockets.cpp b/Source/platform/ctr/sockets.cpp index ce57a5a02..4bff0f938 100644 --- a/Source/platform/ctr/sockets.cpp +++ b/Source/platform/ctr/sockets.cpp @@ -3,6 +3,12 @@ #include #include +// This header must be included before any 3DS code +// because 3DS SDK defines a macro with the same name +// as an fmt template parameter in some versions of fmt. +// See https://github.com/fmtlib/fmt/issues/3632 +#include + #include <3ds.h> #include "utils/log.hpp"