From 21fb27735add9f7f4307e0930286f5fc8aa1a206 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 23 Sep 2025 18:44:14 +0200 Subject: [PATCH] os: unexport XNFreallocarray() Not used by any drivers, no no need to keep it in public SDK. Since it's not used by drivers, it's effectively not an ABI change, so can be done within ABI-25. Signed-off-by: Enrico Weigelt, metux IT consult --- Xi/exevents.c | 1 + hw/xfree86/common/xf86AutoConfig.c | 2 ++ hw/xfree86/common/xf86Bus.c | 1 + hw/xfree86/common/xf86Helper.c | 1 + hw/xfree86/common/xf86pciBus.c | 1 + hw/xfree86/common/xf86platformBus.c | 1 + hw/xfree86/i2c/xf86i2c.c | 2 ++ include/os.h | 7 ------- os/alloc.c | 3 ++- os/osdep.h | 6 ++++++ 10 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Xi/exevents.c b/Xi/exevents.c index 7000454f87..8e1b8880ed 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -82,6 +82,7 @@ SOFTWARE. #include "dix/cursor_priv.h" #include "os/bug_priv.h" +#include "os/osdep.h" #include #include diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index 24d37ba703..4178215871 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -33,6 +33,8 @@ #include #endif +#include "os/osdep.h" + #include "xf86.h" #include "xf86Parser_priv.h" #include "xf86tokens.h" diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 7d874eb4b1..0c9dc5c2f4 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -39,6 +39,7 @@ #include #include "config/hotplug_priv.h" +#include "os/osdep.h" #include "os.h" #include "xf86_priv.h" diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 7b193a9412..7a654fcf40 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -45,6 +45,7 @@ #include "dix/input_priv.h" #include "mi/mi_priv.h" #include "os/log_priv.h" +#include "os/osdep.h" #include "os.h" #include "servermd.h" diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index 7c8913bdd4..0d3a04673f 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -39,6 +39,7 @@ #include #include "os/log_priv.h" +#include "os/osdep.h" #include "os.h" #include "Pci.h" diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index 7a97986ddd..19588d76c6 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -40,6 +40,7 @@ #include "config/hotplug_priv.h" #include "dix/screenint_priv.h" #include "randr/randrstr_priv.h" +#include "os/osdep.h" #include "os.h" #include "../os-support/linux/systemd-logind.h" diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c index c70aaf1ac4..1668278bed 100644 --- a/hw/xfree86/i2c/xf86i2c.c +++ b/hw/xfree86/i2c/xf86i2c.c @@ -13,6 +13,8 @@ #include #include +#include "os/osdep.h" + #include "misc.h" #include "xf86.h" #include "xf86_OSproc.h" diff --git a/include/os.h b/include/os.h index da6b3d6fe7..675d5335d4 100644 --- a/include/os.h +++ b/include/os.h @@ -166,13 +166,6 @@ XNFcallocarray(size_t nmemb, size_t size) __attribute__((returns_nonnull)); extern _X_EXPORT void * XNFrealloc(void * /*ptr */ , unsigned long /*amount */ ); -/* - * This function reallocarray(3)s passed buffer, terminating the server if - * there is not enough memory or the arguments overflow when multiplied. - */ -extern _X_EXPORT void * -XNFreallocarray(void *ptr, size_t nmemb, size_t size); - /* * This function strdup(3)s passed string. The only difference from the library * function that it is safe to pass NULL, as NULL will be returned. diff --git a/os/alloc.c b/os/alloc.c index 5049957f12..0a00c6386e 100644 --- a/os/alloc.c +++ b/os/alloc.c @@ -7,7 +7,8 @@ #include -#include "os.h" +#include "include/os.h" +#include "os/osdep.h" void * XNFalloc(unsigned long amount) diff --git a/os/osdep.h b/os/osdep.h index c8c733aa52..b30743a304 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -203,6 +203,12 @@ extern Bool CoreDump; extern Bool NoListenAll; extern Bool AllowByteSwappedClients; +/* + * This function reallocarray(3)s passed buffer, terminating the server if + * there is not enough memory or the arguments overflow when multiplied. + */ +void *XNFreallocarray(void *ptr, size_t nmemb, size_t size); + #if __has_builtin(__builtin_popcountl) # define Ones __builtin_popcountl #else