/
index
/
libcext.git
/ commitdiff
commit
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
inline
| side by side (parent:
fd4273e
)
remove "program_invocation_short_name" dependency for Linux
author
git
<redacted>
Sat, 18 Apr 2026 15:48:06 +0000
(11:48 -0400)
committer
git
<redacted>
Sat, 18 Apr 2026 15:48:06 +0000
(11:48 -0400)
getopt_long.h
patch
|
blob
|
history
diff --git
a/getopt_long.h
b/getopt_long.h
index f26dd572def7591607dcc0db6c1db1170a4922f7..c2e1a3628bc0a3941a3b0773fe3d0fd2a27f7331 100644
(file)
--- a/
getopt_long.h
+++ b/
getopt_long.h
@@
-52,9
+52,10
@@
#define GETOPT_LONG_H_ 1
#ifdef GETOPT_LONG_INCLUDE_LIBC
#define GETOPT_LONG_H_ 1
#ifdef GETOPT_LONG_INCLUDE_LIBC
+ #include <stdarg.h>
+ #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
- #include <stdarg.h>
#endif
#ifndef HAVE_GETOPT_LONG
#endif
#ifndef HAVE_GETOPT_LONG
@@
-145,12
+146,10
@@
i_warnx_(const char *fmt, ...)
{
va_list args;
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()
#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
#else
#define I_GET_PROG_NAME_() "warnx"
#endif