Fixes ci on macos and improve macros guards in glxext.c
cc @zmike @ajax @jenatali @alyssa
Fixes the github ci fail:
The fail is at https://github.com/Mesa3D/mesa/actions/runs/3101051153/jobs/5021999607#step:6:3596
[1245/1285] Compiling C object src/glx/libglx.a.p/glxcmds.c.o
In file included from ../src/glx/glxcmds.c:44:
In file included from ../src/glx/apple/apple_glx_context.h:49:
../src/glx/apple/apple_glx_drawable.h:74:4: warning: 'CGLPBufferObj' is deprecated: first deprecated in macOS 10.7 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]
CGLPBufferObj buffer_obj;
^
/Applications/Xcode_13.2.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers/CGLTypes.h:48:41: note: 'CGLPBufferObj' has been explicitly marked deprecated here
typedef struct _CGLPBufferObject *CGLPBufferObj OPENGL_DEPRECATED(10.3, 10.7);
^
1 warning generated.
[1246/1285] Compiling C object src/glx/libglx.a.p/glxext.c.o
FAILED: src/glx/libglx.a.p/glxext.c.o
cc -Isrc/glx/libglx.a.p -Isrc/glx -I../src/glx -Iinclude -I../include -Isrc -I../src -Isrc/mapi -I../src/mapi -Isrc/mesa -I../src/mesa -I../src/gallium/include -Isrc/gallium/auxiliary -I../src/gallium/auxiliary -Isrc/mapi/glapi -I../src/mapi/glapi -Isrc/loader -I../src/loader -Isrc/util -I../src/util -Isrc/mapi/glapi/gen -I/usr/local/Cellar/xorgproto/2022.2/include -I/usr/local/Cellar/libx11/1.8.1/include -I/usr/local/Cellar/libxcb/1.15/include -I/usr/local/Cellar/libxau/1.0.10/include -I/usr/local/Cellar/libxdmcp/1.1.3/include -fvisibility=hidden -fcolor-diagnostics -Wall -Winvalid-pch -std=c11 -O2 -g -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DPACKAGE_VERSION="22.3.0-devel"' '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"' -DHAVE_SWRAST -DBUILDING_MESA -DVIDEO_CODEC_VC1DEC=0 -DVIDEO_CODEC_H264DEC=0 -DVIDEO_CODEC_H264ENC=0 -DVIDEO_CODEC_H265DEC=0 -DVIDEO_CODEC_H265ENC=0 -DHAVE_X11_PLATFORM -DHAVE_XCB_PLATFORM -DENABLE_ST_OMX_BELLAGIO=0 -DENABLE_ST_OMX_TIZONIA=0 -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_APPLEGL -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE___BUILTIN_TYPES_COMPATIBLE_P -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_NORETURN -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_UINT128 -DUSE_SSE41 -DUSE_GCC_ATOMIC_BUILTINS -DHAS_SCHED_H -DHAVE_SYS_SYSCTL_H -DHAVE_XLOCALE_H -DHAVE_DLFCN_H -DHAVE_SYS_SHM_H -DHAVE_CET_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_TIMESPEC_GET -DHAVE_FLOCK -DHAVE_STRTOK_R -DHAVE_QSORT_R -DHAVE_STRUCT_TIMESPEC -DHAVE_POSIX_MEMALIGN -DHAVE_DIRENT_D_TYPE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_ZLIB -DHAVE_ZSTD -DHAVE_COMPRESSION -DHAVE_PTHREAD -DLLVM_AVAILABLE '-DMESA_LLVM_VERSION_STRING="14.0.6"' -DLLVM_IS_SHARED=1 -DDRAW_LLVM_AVAILABLE -DMESA_EXECMEM -DHAVE_LIBUNWIND -DHAVE_DRI -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -DVK_USE_PLATFORM_MACOS_MVK -DVK_USE_PLATFORM_METAL_EXT -DVK_ENABLE_BETA_EXTENSIONS -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=empty-body -Werror=incompatible-pointer-types -Werror=int-conversion -Wimplicit-fallthrough -Wno-missing-field-initializers -fno-math-errno -fno-trapping-math -Qunused-arguments -fno-common -Wno-microsoft-enum-value -Wno-unused-function -Werror=format -Wformat-security -Werror=thread-safety '-DGL_LIB_NAME="libGL.so.1"' -MD -MQ src/glx/libglx.a.p/glxext.c.o -MF src/glx/libglx.a.p/glxext.c.o.d -o src/glx/libglx.a.p/glxext.c.o -c ../src/glx/glxext.c
../src/glx/glxext.c:979:11: error: use of undeclared identifier 'infer_zink'
if (infer_zink && !explicit_zink) {
^
../src/glx/glxext.c:979:26: error: use of undeclared identifier 'explicit_zink'
if (infer_zink && !explicit_zink) {
^
../src/glx/glxext.c:981:10: error: implicit declaration of function 'driswCreateDisplay' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
driswCreateDisplay(dpy, false);
^
3 errors generated.
Edited by Yonggang Luo