From ebabca56a4ca1980bfae557a9c0ac32b86a85a0c Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 14 Feb 2024 16:51:17 +0100 Subject: [PATCH] consolidate MITSHM and HAS_SHM symbols Both symbols are set on exactly the same condition (build_mitshm), so can be consolidated into one: MITSHM Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- Xext/xf86bigfont.c | 22 +++++++++++----------- hw/vfb/InitOutput.c | 22 +++++++++++----------- include/meson.build | 1 - include/xorg-server.h.meson.in | 3 --- 4 files changed, 22 insertions(+), 26 deletions(-) diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index 529595bb7..44a8e7dd8 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -39,7 +39,7 @@ #endif #include -#ifdef HAS_SHM +#ifdef MITSHM #ifdef SVR4 #include #endif @@ -73,7 +73,7 @@ static void XF86BigfontResetProc(ExtensionEntry * /* extEntry */ ); -#ifdef HAS_SHM +#ifdef MITSHM /* A random signature, transmitted to the clients so they can verify that the shared memory segment they are attaching to was really established by the @@ -126,7 +126,7 @@ CheckForShmSyscall(void) /* ========== Management of shared memory segments ========== */ -#ifdef HAS_SHM +#ifdef MITSHM #ifdef __linux__ /* On Linux, shared memory marked as "removed" can still be attached. @@ -221,7 +221,7 @@ shmdealloc(ShmDescPtr pDesc) void XF86BigfontFreeFontShm(FontPtr pFont) { -#ifdef HAS_SHM +#ifdef MITSHM ShmDescPtr pDesc; /* If during shutdown of the server, XF86BigfontCleanup() has already @@ -240,7 +240,7 @@ XF86BigfontFreeFontShm(FontPtr pFont) void XF86BigfontCleanup(void) { -#ifdef HAS_SHM +#ifdef MITSHM while (ShmList) shmdealloc(ShmList); #endif @@ -277,7 +277,7 @@ ProcXF86BigfontQueryVersion(ClientPtr client) .minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION, .uid = geteuid(), .gid = getegid(), -#ifdef HAS_SHM +#ifdef MITSHM .signature = signature, .capabilities = (client->local && !client->swapped) ? XF86Bigfont_CAP_LocalShm : 0 @@ -329,7 +329,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) int nCharInfos; int shmid; -#ifdef HAS_SHM +#ifdef MITSHM ShmDescPtr pDesc = NULL; #else #define pDesc 0 @@ -374,7 +374,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) nUniqCharInfos = 0; if (nCharInfos > 0) { -#ifdef HAS_SHM +#ifdef MITSHM if (!badSysCall) pDesc = (ShmDescPtr) FontGetPrivate(pFont, FontShmdescIndex); if (pDesc) { @@ -395,7 +395,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) pCI = xallocarray(nCharInfos, sizeof(xCharInfo)); if (!pCI) return BadAlloc; -#ifdef HAS_SHM +#ifdef MITSHM } #endif /* Fill nCharInfos starting at pCI. */ @@ -427,7 +427,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) } } } -#ifdef HAS_SHM +#ifdef MITSHM if (pDesc && !badSysCall) { *(CARD32 *) (pCI + nCharInfos) = signature; if (!xfont2_font_set_private(pFont, FontShmdescIndex, pDesc)) { @@ -694,7 +694,7 @@ XFree86BigfontExtensionInit(void) ProcXF86BigfontDispatch, SProcXF86BigfontDispatch, XF86BigfontResetProc, StandardMinorOpcode)) { -#ifdef HAS_SHM +#ifdef MITSHM #ifdef MUST_CHECK_FOR_SHM_SYSCALL /* * Note: Local-clients will not be optimized without shared memory diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 29223ceef..f01901153 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -59,10 +59,10 @@ from The Open Group. #include #endif #include -#ifdef HAS_SHM +#ifdef MITSHM #include #include -#endif /* HAS_SHM */ +#endif /* MITSHM */ #include "dix.h" #include "miline.h" #include "glx_extinit.h" @@ -98,7 +98,7 @@ typedef struct { char mmap_file[MAXPATHLEN]; #endif -#ifdef HAS_SHM +#ifdef MITSHM int shmid; #endif } vfbScreenInfo, *vfbScreenInfoPtr; @@ -173,17 +173,17 @@ freeScreenInfo(vfbScreenInfoPtr pvfb) break; #endif /* HAVE_MMAP */ -#ifdef HAS_SHM +#ifdef MITSHM case SHARED_MEMORY_FB: if (-1 == shmdt((char *) pvfb->pXWDHeader)) { perror("shmdt"); ErrorF("shmdt failed, %s", strerror(errno)); } break; -#else /* HAS_SHM */ +#else /* MITSHM */ case SHARED_MEMORY_FB: break; -#endif /* HAS_SHM */ +#endif /* MITSHM */ case NORMAL_MEMORY_FB: free(pvfb->pXWDHeader); @@ -252,7 +252,7 @@ ddxUseMsg(void) ("-fbdir directory put framebuffers in mmap'ed files in directory\n"); #endif -#ifdef HAS_SHM +#ifdef MITSHM ErrorF("-shmem put framebuffers in shared memory\n"); #endif } @@ -368,7 +368,7 @@ ddxProcessArgument(int argc, char *argv[], int i) } #endif /* HAVE_MMAP */ -#ifdef HAS_SHM +#ifdef MITSHM if (strcmp(argv[i], "-shmem") == 0) { /* -shmem */ fbmemtype = SHARED_MEMORY_FB; return 1; @@ -537,7 +537,7 @@ vfbAllocateMmappedFramebuffer(vfbScreenInfoPtr pvfb) } #endif /* HAVE_MMAP */ -#ifdef HAS_SHM +#ifdef MITSHM static void vfbAllocateSharedMemoryFramebuffer(vfbScreenInfoPtr pvfb) { @@ -563,7 +563,7 @@ vfbAllocateSharedMemoryFramebuffer(vfbScreenInfoPtr pvfb) ErrorF("screen %d shmid %d\n", (int) (pvfb - vfbScreens), pvfb->shmid); } -#endif /* HAS_SHM */ +#endif /* MITSHM */ static char * vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb) @@ -606,7 +606,7 @@ vfbAllocateFramebufferMemory(vfbScreenInfoPtr pvfb) break; #endif -#ifdef HAS_SHM +#ifdef MITSHM case SHARED_MEMORY_FB: vfbAllocateSharedMemoryFramebuffer(pvfb); break; diff --git a/include/meson.build b/include/meson.build index 7d83273b9..a3146ffa9 100644 --- a/include/meson.build +++ b/include/meson.build @@ -212,7 +212,6 @@ conf_data.set('DRI3', build_dri3 ? '1' : false) if build_glx conf_data.set_quoted('DRI_DRIVER_PATH', dri_dep.get_variable(pkgconfig : 'dridriverdir')) endif -conf_data.set('HAS_SHM', build_mitshm ? '1' : false) conf_data.set('MITSHM', build_mitshm ? '1' : false) conf_data.set('PANORAMIX', build_xinerama ? '1' : false) conf_data.set('PRESENT', '1') diff --git a/include/xorg-server.h.meson.in b/include/xorg-server.h.meson.in index 093801cad..1ffc58548 100644 --- a/include/xorg-server.h.meson.in +++ b/include/xorg-server.h.meson.in @@ -41,9 +41,6 @@ /* Support XDM-AUTH*-1 */ #mesondefine HASXDMAUTH -/* Support SHM */ -#mesondefine HAS_SHM - /* Define to 1 if you have the `reallocarray' function. */ #mesondefine HAVE_REALLOCARRAY