#63355 closed defect (fixed)
quartz-wm @1.3.2: error: typedef redefinition with different types ('XID' (aka 'unsigned long') vs 'struct Picture')
Reported by: | TruePath (Peter Gerdes) | Owned by: | jeremyhu (Jeremy Huddleston Sequoia) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | monterey | Cc: | cjones051073 (Chris Jones), tglsfdc (Tom Lane), iqgrande, i0ntempest |
Port: | quartz-wm, xorg-xorgproto |
Description
On OS X montery with the latest xcode beta quartz-wm fails to compile with the error:
CC_PRINT_OPTIONS='YES' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_Users_TruePath_Build_portfiles_x11_quartz-wm/quartz-wm/work/.CC_PRINT_OPTIONS' CPATH='/opt/local/include' DEVELOPER_DIR='/Library/Developer/CommandLineTools' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='12.0' SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk' Executing: cd "/opt/local/var/macports/build/_Users_TruePath_Build_portfiles_x11_quartz-wm/quartz-wm/work/quartz-wm-1.3.2" && /usr/bin/make -j8 -w all DEBUG: system: cd "/opt/local/var/macports/build/_Users_TruePath_Build_portfiles_x11_quartz-wm/quartz-wm/work/quartz-wm-1.3.2" && /usr/bin/make -j8 -w all make: Entering directory `/opt/local/var/macports/build/_Users_TruePath_Build_portfiles_x11_quartz-wm/quartz-wm/work/quartz-wm-1.3.2' /Library/Developer/CommandLineTools/usr/bin/make all-recursive make[1]: Entering directory `/opt/local/var/macports/build/_Users_TruePath_Build_portfiles_x11_quartz-wm/quartz-wm/work/quartz-wm-1.3.2' Making all in src make[2]: Entering directory `/opt/local/var/macports/build/_Users_TruePath_Build_portfiles_x11_quartz-wm/quartz-wm/work/quartz-wm-1.3.2/src' ccache /usr/bin/clang -DHAVE_CONFIG_H -I. -I.. -I../lib -DXP_NO_X_HEADERS -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I/opt/local/include/pixman-1 -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch arm64 -MT x-input.o -MD -MP -MF .deps/x-input.Tpo -c -o x-input.o x-input.m In file included from x-input.m:29: In file included from ./quartz-wm.h:42: ../lib/dock-support.h:53:5: warning: 'xp_init' is deprecated [-Wdeprecated-declarations] xp_init(options); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/Xplugin.h:329:1: note: 'xp_init' has been explicitly marked deprecated here XPLUGIN_VERSION_0 ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/Xplugin.h:95:27: note: expanded from macro 'XPLUGIN_VERSION_0' #define XPLUGIN_VERSION_0 XPLUGIN_AVAILABILITY ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/Xplugin.h:57:45: note: expanded from macro 'XPLUGIN_AVAILABILITY' #define XPLUGIN_AVAILABILITY __attribute__((deprecated)) ^ In file included from x-input.m:41: In file included from /opt/local/include/X11/extensions/Xrandr.h:33: In file included from /opt/local/include/X11/extensions/Xrender.h:33: /opt/local/include/X11/extensions/render.h:31:14: error: typedef redefinition with different types ('XID' (aka 'unsigned long') vs 'struct Picture') typedef XID Picture; ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:191:41: note: previous definition is here typedef struct Picture Picture; ^
Attachments (1)
Change History (14)
comment:1 Changed 3 years ago by TruePath (Peter Gerdes)
comment:2 Changed 3 years ago by reneeotten (Renee Otten)
please remember not to discuss pre-releases here.
comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | cjones051073 added |
---|---|
Keywords: | monterey added |
Owner: | set to jeremyhu |
Port: | xorg-xorgproto added |
Status: | new → assigned |
Summary: | quartz-wm fails to compile on os X montery with Xcode 13 beta 4 → quartz-wm @1.3.2: error: typedef redefinition with different types ('XID' (aka 'unsigned long') vs 'struct Picture') |
/opt/local/include/X11/extensions/render.h is provided by xorg-xorgproto so the bug may be there. Or it may be in the system headers. Wherever it's coming from, the inclusion of Quickdraw.h (which is ancient history from the beginning of the Macintosh) is surprising to me.
comment:4 Changed 3 years ago by kencu (Ken)
These QuickDraw globals are sometimes pulled in on various ports; they have unfortunately generic names, and often conflict with other software's choice of names, like "Picture". I had to work around this in the surf
port, for example.
This port, quartz-wm
already tries to solve this problem, by doing this in quartz-wm.h
:
#define Cursor OSX_Cursor #define Picture OSX_Picture #import <Foundation/Foundation.h> #undef Picture #undef Cursor
This is the standard trick -- you define the conflicting variable to something else, include the problematic files, and then undefine it after.
That has worked in every system from 10.4 up to BigSur, and in other ports.
The question is why is that not working now, in Monterey?
comment:5 Changed 3 years ago by slarew
Cc: | slarew added |
---|
Changed 3 years ago by tglsfdc (Tom Lane)
Attachment: | monterey-fix.patch added |
---|
comment:6 Changed 3 years ago by tglsfdc (Tom Lane)
Apparently Apple rearranged their headers enough that Quickdraw.h is being pulled in from a different place.
I was able to get it to build with the attached inelegant hack.
comment:7 Changed 3 years ago by tglsfdc (Tom Lane)
Cc: | tglsfdc added |
---|
comment:8 Changed 3 years ago by iqgrande
Cc: | iqgrande added |
---|
comment:9 Changed 3 years ago by i0ntempest
Cc: | i0ntempest added |
---|
comment:10 Changed 3 years ago by Chris Jones <jonesc@…>
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:11 Changed 3 years ago by cjones051073 (Chris Jones)
I've committed this as it works fine for me, with it I was able to build and run xorg-server just fine on macOS12. The maintainer can switch it out for a better fix later on, if such a fix becomes available.
comment:13 Changed 9 months ago by slarew
Cc: | slarew removed |
---|
Oops, forgot to specify this is on Apple Silicon.