git: 906ef9acf9b9 - 2023Q4 - devel/quickcpplib: fix on 32 bit platforms

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Fri, 27 Oct 2023 06:35:34 UTC
The branch 2023Q4 has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=906ef9acf9b9578cfab90e69b5da610a06ea305d

commit 906ef9acf9b9578cfab90e69b5da610a06ea305d
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-10-24 05:10:22 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-10-27 06:35:09 +0000

    devel/quickcpplib: fix on 32 bit platforms
    
    128 bit integers are only supported on 64 bit platforms.  Test for them
    using the correct feature test macro to enable the port there.
    
    Approved by:    portmgr (build fix blanket)
    MFH:            2023Q4
    See also:       https://github.com/ned14/quickcpplib/issues/50
    
    (cherry picked from commit 7e25442cf7355486041ebb30c77a7c815aa3e701)
---
 devel/quickcpplib/Makefile                         |  3 +-
 .../files/patch-include_quickcpplib_uint128.hpp    | 65 ++++++++++++++++++++++
 2 files changed, 66 insertions(+), 2 deletions(-)

diff --git a/devel/quickcpplib/Makefile b/devel/quickcpplib/Makefile
index d729a65f7ea2..be416b9a4fdd 100644
--- a/devel/quickcpplib/Makefile
+++ b/devel/quickcpplib/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	quickcpplib
 DISTVERSION=	g20230614
+PORTREVISION=	1
 CATEGORIES=	devel
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -9,8 +10,6 @@ WWW=		https://github.com/ned14/quickcpplib
 LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/Licence.txt
 
-BROKEN_i386=	complation fails: __int128 is not supported on this target
-
 USES=		cmake:testing
 
 USE_GITHUB=	yes
diff --git a/devel/quickcpplib/files/patch-include_quickcpplib_uint128.hpp b/devel/quickcpplib/files/patch-include_quickcpplib_uint128.hpp
new file mode 100644
index 000000000000..42004d9b622d
--- /dev/null
+++ b/devel/quickcpplib/files/patch-include_quickcpplib_uint128.hpp
@@ -0,0 +1,65 @@
+--- include/quickcpplib/uint128.hpp.orig	2023-10-24 05:06:15 UTC
++++ include/quickcpplib/uint128.hpp
+@@ -53,7 +53,7 @@ namespace integers128
+ #if defined(__SSE2__) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)
+     __m128i as_m128i;
+ #endif
+-#if defined(__GNUC__) || defined(__clang__)
++#if defined(__SIZEOF_INT128__)
+     unsigned __int128 as_uint128;
+ #endif
+     //! Default constructor, no bits set
+@@ -100,7 +100,7 @@ namespace integers128
+     }
+     uint128 operator+=(const uint128 &v) noexcept
+     {
+-#if defined(__GNUC__) || defined(__clang__)
++#if defined(__SIZEOF_INT128__)
+       as_uint128 += v.as_uint128;
+       return *this;
+ #endif
+@@ -118,7 +118,7 @@ namespace integers128
+     }
+     uint128 operator-=(const uint128 &v) noexcept
+     {
+-#if defined(__GNUC__) || defined(__clang__)
++#if defined(__SIZEOF_INT128__)
+       as_uint128 -= v.as_uint128;
+       return *this;
+ #endif
+@@ -146,7 +146,7 @@ namespace integers128
+     {
+       if(!b)
+         throw std::domain_error("divide by zero");
+-#if defined(__GNUC__) || defined(__clang__)
++#if defined(__SIZEOF_INT128__)
+       as_uint128 %= b.as_uint128;
+       return *this;
+ #endif
+@@ -169,7 +169,7 @@ namespace integers128
+     {
+       if(!b)
+         throw std::domain_error("divide by zero");
+-#if defined(__GNUC__) || defined(__clang__)
++#if defined(__SIZEOF_INT128__)
+       as_uint128 %= b;
+       return *this;
+ #endif
+@@ -215,7 +215,7 @@ namespace integers128
+     }
+     uint128 operator<<=(uint8_t v) noexcept
+     {
+-#if defined(__GNUC__) || defined(__clang__)
++#if defined(__SIZEOF_INT128__)
+       as_uint128 <<= v;
+       return *this;
+ #endif
+@@ -232,7 +232,7 @@ namespace integers128
+     }
+     uint128 operator>>=(uint8_t v) noexcept
+     {
+-#if defined(__GNUC__) || defined(__clang__)
++#if defined(__SIZEOF_INT128__)
+       as_uint128 >>= v;
+       return *this;
+ #endif