summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Weigelt, metux IT consult <info@metux.net>2024-03-15 18:32:39 +0100
committerMarge Bot <emma+marge@anholt.net>2024-04-18 00:12:02 +0000
commite2fa0d2ae0d96bac694e6249f77745071fa5ebfe (patch)
treeaa9da9f1ac864f0b1457f8c2889aef16386f81ee
parent8ce76acddf5ae83546a0b9fbc01c862007ccba72 (diff)
fix including <sys/mman.h>
Make sure everybody who needs stuff from <sys/mman.h> actually includes it, and dropped the include from xf86_OSlib.h. Check for all symbols defined by Open Group spec. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1412>
-rw-r--r--Xext/shm.c2
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.c1
-rw-r--r--hw/xfree86/os-support/bsd/alpha_video.c3
-rw-r--r--hw/xfree86/os-support/bsd/arm_video.c1
-rw-r--r--hw/xfree86/os-support/bsd/i386_video.c7
-rw-r--r--hw/xfree86/os-support/bsd/ppc_video.c2
-rw-r--r--hw/xfree86/os-support/linux/lnx_video.c3
-rw-r--r--hw/xfree86/os-support/xf86_OSlib.h3
8 files changed, 11 insertions, 11 deletions
diff --git a/Xext/shm.c b/Xext/shm.c
index b3ab676ea..a17915a67 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -35,9 +35,7 @@ in this Software without prior written authorization from The Open Group.
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
-#ifdef HAVE_MEMFD_CREATE
#include <sys/mman.h>
-#endif
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index 8d4e3c596..76bc4809f 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -4,6 +4,7 @@
#endif
#include <string.h>
+#include <sys/mman.h>
#include "xf86.h"
#include "xf86Modes.h"
diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c
index 721c09af8..670193c0d 100644
--- a/hw/xfree86/os-support/bsd/alpha_video.c
+++ b/hw/xfree86/os-support/bsd/alpha_video.c
@@ -28,12 +28,13 @@
#endif
#include <errno.h>
+#include <sys/mman.h>
+#include <sys/param.h>
#include <X11/X.h>
#include "xf86.h"
#include "xf86Priv.h"
-#include <sys/param.h>
#ifndef __NetBSD__
#include <sys/sysctl.h>
#endif
diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
index 587b9d3ac..647ebf46c 100644
--- a/hw/xfree86/os-support/bsd/arm_video.c
+++ b/hw/xfree86/os-support/bsd/arm_video.c
@@ -61,6 +61,7 @@
#endif
#include <errno.h>
+#include <sys/mman.h>
#include <X11/X.h>
#include "xf86.h"
diff --git a/hw/xfree86/os-support/bsd/i386_video.c b/hw/xfree86/os-support/bsd/i386_video.c
index 55b5819b7..625514e70 100644
--- a/hw/xfree86/os-support/bsd/i386_video.c
+++ b/hw/xfree86/os-support/bsd/i386_video.c
@@ -27,13 +27,12 @@
#include <xorg-config.h>
#endif
-#include <X11/X.h>
-#include "xf86.h"
-#include "xf86Priv.h"
-
#include <errno.h>
#include <sys/mman.h>
+#include <X11/X.h>
+#include "xf86.h"
+#include "xf86Priv.h"
#include "xf86_OSlib.h"
#include "xf86OSpriv.h"
diff --git a/hw/xfree86/os-support/bsd/ppc_video.c b/hw/xfree86/os-support/bsd/ppc_video.c
index 9d430ba86..bd929b208 100644
--- a/hw/xfree86/os-support/bsd/ppc_video.c
+++ b/hw/xfree86/os-support/bsd/ppc_video.c
@@ -27,7 +27,9 @@
#include <xorg-config.h>
#endif
+#include <sys/mman.h>
#include <X11/X.h>
+
#include "xf86.h"
#include "xf86Priv.h"
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index fd83022f6..8ff0f0bc5 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -29,8 +29,9 @@
#include <errno.h>
#include <string.h>
-
+#include <sys/mman.h>
#include <X11/X.h>
+
#include "input.h"
#include "scrnintstr.h"
diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
index 3f8dae067..90d560eef 100644
--- a/hw/xfree86/os-support/xf86_OSlib.h
+++ b/hw/xfree86/os-support/xf86_OSlib.h
@@ -128,7 +128,6 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX];
#endif /* !VT_ACKACQ */
#if defined(SVR4)
-#include <sys/mman.h>
#if !(defined(__sun) && defined (SVR4))
#define DEV_MEM "/dev/pmem"
#endif
@@ -154,7 +153,6 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX];
#include <errno.h>
-#include <sys/mman.h>
#ifdef __linux__
#define HAS_USL_VTS
#include <sys/kd.h>
@@ -181,7 +179,6 @@ extern _X_HIDDEN char xf86SolarisFbDev[PATH_MAX];
#include <errno.h>
#include <sys/types.h>
-#include <sys/mman.h>
#endif /* CSRG_BASED */