From nobody Tue Oct 29 08:46:50 2024 X-Original-To: dev-commits-ports-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xd3lZ1qKhz5bBZt; Tue, 29 Oct 2024 08:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xd3lZ19dkz4jxk; Tue, 29 Oct 2024 08:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730191610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PsmNsVcy9hS/39NqhEXtdCDmW7bEb07sbSa5OSeI/bw=; b=s2GcLBXEJoQasjxh15FUGecEogqeQnj71zOTK0+/pGyK1LjR2vq4W2FPPPHdYBgA8Fr9ot tEcMoOTy01D1agL+t3MrnW2IiGpMRaPllQW7U37vmyYgXy2QgsnqNGnCRaUcyjOPufEUyG zeQVwDuux/3iVVGTRONCS34aWVy6yR8amcaE1/uMg39kS/tzpcjd5JH7QFDyjmT8KKwFqT E1jrxdJaXIX94klHWLYSilsPxx8Jin99yJx0iocld2+ZglyPTc/5gWhsCkZKV+VGXZlj8s Gp7PT0UmHFnyi/aVdQJi+e9lH50CKlMUaMtIU/2Ecv7CptVz6QBeSfIQlJZCOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730191610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PsmNsVcy9hS/39NqhEXtdCDmW7bEb07sbSa5OSeI/bw=; b=cHQ+KPVxQjGEpdXYdnYbsM383fEMzLOfkp36wNM6dWQ4ESp1J95YeBs5hUoOi8DPGg43ib MAFegR4UMn7uf2PdItCzEA2gjw2O2gSGryeeXB0Mo3ZeL9mx3Q5RjF5KOd9zu5eHfWWAee LvGSneQ2/cbc3v36838iDNtek3B3GMEcfhI7pSjAS1mpECyBS3e6kamQoOar4+ASHPgk3P 9vqzym+yp2E8GP6aEzngEfHdgoS1smVbfjlhEhZ4Wv799EKX0lRaVway72mNB3MbMXpopf lf5FSzYZC0ZXBSHVvzeZV1HRVSgbg8J9dfb1d9mYrG65FQyPckhBrTPcuVUw6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730191610; a=rsa-sha256; cv=none; b=sIIXWnnwSiXk4lnBmizzPv8/X1wTTwImF+ZQeUFiilwSOQY+DcCRzmONSSivLUMOq4wdyJ AcyhW5aevDdaDVj4/oKI1AKhX3CTp4fr9/1fa8QfUg8GQTPmzj1dQyntTZWjD2diY8D/fK h14gYJa4XXPcgjyogDKW4RX1wGhekUkDlVG+RdGA6JRxCAcEbMmsqllXZ6mmDXHlqMsQGZ Ec2p7Of5boVpgCBcy4IU7SWvP8nFk55IgOTXd9qZLMVUVFOW4oY0nOt1JefzWpKMnrg8Ge JtKxKOQXU8VS0adhLbSCC2Uc601rjWvg/jIv39Ii7+CJpYGKBLpzpDYYQXjjhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xd3lZ0mbDzGvC; Tue, 29 Oct 2024 08:46:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49T8kom9098737; Tue, 29 Oct 2024 08:46:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49T8ko4w098734; Tue, 29 Oct 2024 08:46:50 GMT (envelope-from git) Date: Tue, 29 Oct 2024 08:46:50 GMT Message-Id: <202410290846.49T8ko4w098734@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Nuno Teixeira Subject: git: 74d67a6f3e28 - 2024Q4 - emulators/dosbox-x: Fix build with libc++ 19 List-Id: Commits to the quarterly branches of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-branches@freebsd.org Sender: owner-dev-commits-ports-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eduardo X-Git-Repository: ports X-Git-Refname: refs/heads/2024Q4 X-Git-Reftype: branch X-Git-Commit: 74d67a6f3e28800b7b6904d0dbd3a2fc071b1e52 Auto-Submitted: auto-generated The branch 2024Q4 has been updated by eduardo: URL: https://cgit.FreeBSD.org/ports/commit/?id=74d67a6f3e28800b7b6904d0dbd3a2fc071b1e52 commit 74d67a6f3e28800b7b6904d0dbd3a2fc071b1e52 Author: Dimitry Andric AuthorDate: 2024-10-29 08:29:00 +0000 Commit: Nuno Teixeira CommitDate: 2024-10-29 08:31:59 +0000 emulators/dosbox-x: Fix build with libc++ 19 As noted in the libc++ 19 release notes [1], std::char_traits<> is now only provided for char, char8_t, char16_t, char32_t and wchar_t, and any instantiation for other types will fail. This causes emulators/dosbox-x to fail to compile with clang 19 and libc++ 19, resulting in errors similar to: /usr/include/c++/v1/string:820:42: error: implicit instantiation of undefined template 'std::char_traits' 820 | static_assert(is_same<_CharT, typename traits_type::char_type>::value, | ^ dos_programs.cpp:7692:17: note: in instantiation of template class 'std::basic_string' requested here 7692 | test_string dst; | ^ /usr/include/c++/v1/__fwd/string.h:23:29: note: template is declared here 23 | struct _LIBCPP_TEMPLATE_VIS char_traits; | ^ dos_programs.cpp:8893:14: warning: variable 'open' set but not used [-Wunused-but-set-variable] 8893 | bool open=false; | ^ This can be fixed by using char16_t for the 'test_char_t` type, and by adding a few inline wrappers to perform the required casting. [1] https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals PR: 282386 MFH: 2024Q4 (cherry picked from commit 573cdb2e7e34d6e97828e0b42456b17fc7c13f4b) --- .../dosbox-x/files/patch-src_dos_dos__programs.cpp | 24 +++++++++++++++ .../dosbox-x/files/patch-src_dos_drive__iso.cpp | 34 ++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/emulators/dosbox-x/files/patch-src_dos_dos__programs.cpp b/emulators/dosbox-x/files/patch-src_dos_dos__programs.cpp new file mode 100644 index 000000000000..07b492f03787 --- /dev/null +++ b/emulators/dosbox-x/files/patch-src_dos_dos__programs.cpp @@ -0,0 +1,24 @@ +Fix build with clang 19 +https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282386 + +--- src/dos/dos_programs.cpp.orig 2024-10-02 06:16:36 UTC ++++ src/dos/dos_programs.cpp +@@ -81,7 +81,7 @@ host_cnv_char_t *CodePageGuestToHost(const char *s); + #endif + #ifdef C_ICONV + #include "iconvpp.hpp" +-typedef uint16_t test_char_t; ++typedef char16_t test_char_t; + typedef std::basic_string test_string; + typedef std::basic_string test_char; + #endif +@@ -102,6 +102,9 @@ bool CodePageHostToGuestUTF8(char *d/*CROSS_LEN*/,cons + bool qmount = false; + bool nowarn = false; + bool CodePageHostToGuestUTF8(char *d/*CROSS_LEN*/,const char *s/*CROSS_LEN*/), CodePageHostToGuestUTF16(char *d/*CROSS_LEN*/,const uint16_t *s/*CROSS_LEN*/); ++inline bool CodePageHostToGuestUTF16(char *d/*CROSS_LEN*/,const char16_t *s/*CROSS_LEN*/) { ++ return CodePageHostToGuestUTF16(d, reinterpret_cast(s)); ++} + extern bool systemmessagebox(char const * aTitle, char const * aMessage, char const * aDialogType, char const * aIconType, int aDefaultButton); + extern bool addovl, addipx, addne2k, prepared, inshell, usecon, uao, loadlang, morelen, mountfro[26], mountiro[26], resetcolor, staycolors, printfont, notrycp, internal_program; + extern bool clear_screen(), OpenGL_using(void), DOS_SetAnsiAttr(uint8_t attr), isDBCSCP(); diff --git a/emulators/dosbox-x/files/patch-src_dos_drive__iso.cpp b/emulators/dosbox-x/files/patch-src_dos_drive__iso.cpp new file mode 100644 index 000000000000..80cb9fb5a9f3 --- /dev/null +++ b/emulators/dosbox-x/files/patch-src_dos_drive__iso.cpp @@ -0,0 +1,34 @@ +Fix build with clang 19 +https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282386 + +--- src/dos/drive_iso.cpp.orig 2024-10-02 06:16:36 UTC ++++ src/dos/drive_iso.cpp +@@ -40,6 +40,10 @@ extern bool CodePageHostToGuestUTF16(char *d/*CROSS_LE + extern bool gbk, isDBCSCP(), isKanji1_gbk(uint8_t chr), shiftjis_lead_byte(int c); + extern bool filename_not_8x3(const char *n), filename_not_strict_8x3(const char *n); + extern bool CodePageHostToGuestUTF16(char *d/*CROSS_LEN*/,const uint16_t *s/*CROSS_LEN*/); ++inline bool CodePageHostToGuestUTF16(uint8_t *d/*CROSS_LEN*/,const uint8_t *s/*CROSS_LEN*/) { ++ std::u16string u16s(reinterpret_cast(s)); ++ return CodePageHostToGuestUTF16(reinterpret_cast(d), reinterpret_cast(u16s.c_str())); ++} + + using namespace std; + +@@ -1762,7 +1766,7 @@ int isoDrive::readDirEntry(isoDirEntry* de, const uint + // The string is big Endian UCS-16, convert to host Endian UCS-16 + for (size_t i=0;((const uint16_t*)de->ident)[i] != 0;i++) ((uint16_t*)de->ident)[i] = be16toh(((uint16_t*)de->ident)[i]); + // finally, convert from UCS-16 to local code page, using C++ string construction to make a copy first +- CodePageHostToGuestUTF16((char*)de->ident,std::basic_string((const uint16_t*)de->ident).c_str()); ++ CodePageHostToGuestUTF16(de->ident, de->ident); + } + } + } else { +@@ -1784,7 +1788,7 @@ int isoDrive::readDirEntry(isoDirEntry* de, const uint + // The string is big Endian UCS-16, convert to host Endian UCS-16 + for (size_t i=0;((const uint16_t*)de->ident)[i] != 0;i++) ((uint16_t*)de->ident)[i] = be16toh(((uint16_t*)de->ident)[i]); + // finally, convert from UCS-16 to local code page, using C++ string construction to make a copy first +- CodePageHostToGuestUTF16((char*)de->ident,std::basic_string((const uint16_t*)de->ident).c_str()); ++ CodePageHostToGuestUTF16(de->ident, de->ident); + } + else { + // remove any file version identifiers as there are some cdroms that don't have them