From dd90b872c8591d197c44476c1c7eb06266e72bc0 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 13 Sep 2021 16:33:29 -0700 Subject: Treat musl like glibc Add ANDROID_HOST_MUSL checks to match the __GLIBC__ checks. Bug: 190084016 Test: m USE_HOST_MUSL=true Change-Id: I2de9afcc6d96b5efc01fb5046fd220e552cf03f7 --- freebsd-compat.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/freebsd-compat.h b/freebsd-compat.h index 1fdbafe..7ab9d70 100644 --- a/freebsd-compat.h +++ b/freebsd-compat.h @@ -20,17 +20,17 @@ #if __has_include() #include #endif -// Bionic, like the BSDs, has __unused. glibc doesn't. -#if defined(__GLIBC__) +// Bionic, like the BSDs, has __unused. glibc and musl don't. +#if defined(__GLIBC__) || defined(ANDROID_HOST_MUSL) #define __unused __attribute__((__unused__)) #endif -// Neither macOS nor glibc has __packed. -#if defined(__APPLE__) || defined(__GLIBC__) +// Neither macOS, glibc nor musl has __packed. +#if defined(__APPLE__) || defined(__GLIBC__) || defined(ANDROID_HOST_MUSL) #define __packed __attribute__((__packed__)) #endif -// The BSDs (including Android and macOS) have getprogname(), but glibc doesn't. -#if defined(__GLIBC__) +// The BSDs (including Android and macOS) have getprogname(), but glibc and musl don't. +#if defined(__GLIBC__) || defined(ANDROID_HOST_MUSL) #include static inline char* getprogname() { return program_invocation_short_name; } #endif -- cgit v1.2.3