From 21095adeffe6d053c29019f335ceb5c339a15e8b Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Fri, 12 Oct 2018 15:47:45 +0200 Subject: Properly detect availability of program_invocation_short_name and suppress compiler warning --- src/libusbmuxd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c index 39db216..712c362 100644 --- a/src/libusbmuxd.c +++ b/src/libusbmuxd.c @@ -59,7 +59,7 @@ #include #include #include -#ifdef _GNU_SOURCE +#if defined(HAVE_PROGRAM_INVOCATION_SHORT_NAME) && !defined(HAVE_PROGRAM_INVOCATION_SHORT_NAME_ERRNO_H) extern char *program_invocation_short_name; #endif #ifdef __APPLE__ @@ -521,7 +521,7 @@ static void get_prog_name() #endif } free(_pname); -#elif defined (_GNU_SOURCE) +#elif defined (HAVE_PROGRAM_INVOCATION_SHORT_NAME) char *pname = program_invocation_short_name; if (pname) { prog_name = strdup(pname); -- cgit v1.1-32-gdbae