diff options
author | OBATA Akio <obache@wizdas.com> | 2020-08-17 18:10:50 +0900 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2020-08-17 16:48:59 +0200 |
commit | f31755baa16df88119cafbeec6e8d0e1a33d4986 (patch) | |
tree | 51b7ee06f8017efdd8c421a18dc28d8041f69c6f | |
parent | 3dee97b870a1ec044c9a831488d0d19d7fc737a0 (diff) | |
download | tdelibs-f31755baa16df88119cafbeec6e8d0e1a33d4986.tar.gz tdelibs-f31755baa16df88119cafbeec6e8d0e1a33d4986.zip |
Improve progname detection portability
`getprogname()` of FreeBSD is based on NetBSD's one, no reason to
prevent using it on NetBSD.
glibc also has own special variable for progname.
Signed-off-by: OBATA Akio <obache@wizdas.com>
(cherry picked from commit 965a808b91b6542208b24af18e55193e5f929c37)
-rw-r--r-- | tdeio/tdeio/connection.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tdeio/tdeio/connection.cpp b/tdeio/tdeio/connection.cpp index 9577ad534..5ae0f5685 100644 --- a/tdeio/tdeio/connection.cpp +++ b/tdeio/tdeio/connection.cpp @@ -42,8 +42,10 @@ #include <kdebug.h> #include <tqsocketnotifier.h> -#if defined(__OpenBSD__) || defined(__FreeBSD__) +#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) #define __progname getprogname() +#elif defined(_GNU_SOURCE) && defined(__GLIBC__) +#define __progname program_invocation_short_name #else extern char *__progname; #endif |