remove "program_invocation_short_name" dependency for Linux
authorgit <redacted>
Sat, 18 Apr 2026 15:48:06 +0000 (11:48 -0400)
committergit <redacted>
Sat, 18 Apr 2026 15:48:06 +0000 (11:48 -0400)
getopt_long.h

index f26dd572def7591607dcc0db6c1db1170a4922f7..c2e1a3628bc0a3941a3b0773fe3d0fd2a27f7331 100644 (file)
  #define GETOPT_LONG_H_ 1
 
  #ifdef GETOPT_LONG_INCLUDE_LIBC
+  #include <stdarg.h>
+  #include <stdio.h>
   #include <stdlib.h>
   #include <string.h>
-  #include <stdarg.h>
  #endif
 
  #ifndef HAVE_GETOPT_LONG
   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 <errno.h>
-          #define I_GET_PROG_NAME_() program_invocation_short_name
          #else
           #define I_GET_PROG_NAME_() "warnx"
          #endif