From: git Date: Sat, 18 Apr 2026 15:48:06 +0000 (-0400) Subject: remove "program_invocation_short_name" dependency for Linux X-Git-Url: https://git.datadissipation.net/?a=commitdiff_plain;h=d3f610183255459ba5fbab3e6287ed539fed2a32;p=single-header-libcext.git remove "program_invocation_short_name" dependency for Linux --- diff --git a/getopt_long.h b/getopt_long.h index f26dd57..c2e1a36 100644 --- a/getopt_long.h +++ b/getopt_long.h @@ -52,9 +52,10 @@ #define GETOPT_LONG_H_ 1 #ifdef GETOPT_LONG_INCLUDE_LIBC + #include + #include #include #include - #include #endif #ifndef HAVE_GETOPT_LONG @@ -145,12 +146,10 @@ i_warnx_(const char *fmt, ...) { va_list args; - + + /* Linux "program_invocation_short_name" is a GNU extension, so we don't use it */ #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #define I_GET_PROG_NAME_() getprogname() - #elif defined(__linux__) - #include - #define I_GET_PROG_NAME_() program_invocation_short_name #else #define I_GET_PROG_NAME_() "warnx" #endif