aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-05-20 15:15:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-05-21 09:12:30 +0000
commite5a0215417930a60ac8fbbc630fad6aa354446e5 (patch)
treeec1a36cb4f4ef2eba2da8546f589e5e24c530244
parent8c83725ae0e6342f7b630b613e3009083dd48244 (diff)
downloadports-e5a0215417930a60ac8fbbc630fad6aa354446e5.tar.gz
ports-e5a0215417930a60ac8fbbc630fad6aa354446e5.zip
x11/xorgproto: ensure Xos.h does not define index() as a macro
During the exp-run for clang 16, it turned out that Xos.h defines index() and rindex() as preprocessor macros, and this causes many problems with libc++ headers [1]: /usr/include/c++/v1/variant:532:39: error: too few arguments provided to function-like macro invocation return __at(__fmatrix, __vs.index()...)( ^ /usr/local/include/X11/Xos.h:67:12: note: macro 'index' defined here # define index(s,c) (strchr((s),(c))) ^ /usr/include/c++/v1/variant:813:18: error: too few arguments provided to function-like macro invocation return index() == variant_npos; ^ /usr/local/include/X11/Xos.h:67:12: note: macro 'index' defined here # define index(s,c) (strchr((s),(c))) ^ /usr/include/c++/v1/variant:817:25: error: expected ';' at end of declaration list constexpr size_t index() const noexcept { ^ /usr/include/c++/v1/variant:802:9: error: member initializer '__data' does not name a non-static data member or base class : __data(__tag), __index(__variant_npos<__index_t>) {} ^~~~~~~~~~~~~ /usr/include/c++/v1/variant:808:9: error: member initializer '__data' does not name a non-static data member or base class __data(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/v1/variant:920:23: error: too few arguments provided to function-like macro invocation __rhs.index(), ^ /usr/local/include/X11/Xos.h:67:12: note: macro 'index' defined here # define index(s,c) (strchr((s),(c))) ^ Add defined(__FreeBSD__) to Xos.h's #if block to include <strings.h> instead, so it will get our regular index() and rindex() declarations instead. This has also been sent upstream [2]. [1] <https://pkg-status.freebsd.org/gohan05/data/mainamd64PR271047-default/2023-05-14_19h35m09s/logs/errors/scim-1.4.9_7.log> [2] <https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/73> PR: 271533 Approved by: manu (maintainer) MFH: 2023Q2
-rw-r--r--x11/xorgproto/Makefile1
-rw-r--r--x11/xorgproto/files/patch-include_X11_Xos.h11
2 files changed, 12 insertions, 0 deletions
diff --git a/x11/xorgproto/Makefile b/x11/xorgproto/Makefile
index f11ff7ab68a1..715d3fd010a0 100644
--- a/x11/xorgproto/Makefile
+++ b/x11/xorgproto/Makefile
@@ -1,5 +1,6 @@
PORTNAME= xorgproto
DISTVERSION= 2022.1
+PORTREVISION= 1
CATEGORIES= x11
MAINTAINER= x11@FreeBSD.org
diff --git a/x11/xorgproto/files/patch-include_X11_Xos.h b/x11/xorgproto/files/patch-include_X11_Xos.h
new file mode 100644
index 000000000000..9c60de1c0b51
--- /dev/null
+++ b/x11/xorgproto/files/patch-include_X11_Xos.h
@@ -0,0 +1,11 @@
+--- include/X11/Xos.h.orig 2022-04-21 00:48:08 UTC
++++ include/X11/Xos.h
+@@ -60,7 +60,7 @@ in this Software without prior written authorization f
+ */
+
+ # include <string.h>
+-# if defined(__SCO__) || defined(__UNIXWARE__) || defined(__sun) || defined(__CYGWIN__) || defined(_AIX) || defined(__APPLE__)
++# if defined(__SCO__) || defined(__UNIXWARE__) || defined(__sun) || defined(__CYGWIN__) || defined(_AIX) || defined(__APPLE__) || defined(__FreeBSD__)
+ # include <strings.h>
+ # else
+ # ifndef index