[openwrt/openwrt] tools/util-linux: include macOS system uuid header

LEDE Commits lede-commits at lists.infradead.org
Sat Jul 26 05:38:24 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/89056bd7b109ff4264f07cf721e6d9f4b7ad983e

commit 89056bd7b109ff4264f07cf721e6d9f4b7ad983e
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Thu Jul 3 15:09:25 2025 -0400

    tools/util-linux: include macOS system uuid header
    
    The type definition of uuid_string_t and possibly other details
    used by macOS SDKs like XCode is missing from util-linux.
    
    Headers on macOS have a different inclusion guard
    compared to the unique util-linux "_UL" prefix.
    
    This uuid.h header is guaranteed to be present since macOS 10.8 and iOS 6
    even without the presence of XCode or other SDKs on the system,
    so adding an include_next directive is safe after checking for clang.
    
    Link: https://developer.apple.com/documentation/foundation/uuid
    Link: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/uuid.3.html
    Tested-by: Georgi Valkov <gvalkov at gmail.com> # macOS
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    Link: https://github.com/openwrt/openwrt/pull/16522
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 tools/util-linux/patches/102-macos-uuid-next.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/util-linux/patches/102-macos-uuid-next.patch b/tools/util-linux/patches/102-macos-uuid-next.patch
new file mode 100644
index 0000000000..36346fd522
--- /dev/null
+++ b/tools/util-linux/patches/102-macos-uuid-next.patch
@@ -0,0 +1,13 @@
+--- a/libuuid/src/uuid.h
++++ b/libuuid/src/uuid.h
+@@ -35,6 +35,10 @@
+ #ifndef _UL_LIBUUID_UUID_H
+ #define _UL_LIBUUID_UUID_H
+ 
++#if defined(__clang__) && defined(__APPLE__)
++#include_next <uuid/uuid.h>
++#endif
++
+ #include <sys/types.h>
+ #ifndef _WIN32
+ #include <sys/time.h>




More information about the lede-commits mailing list