summaryrefslogtreecommitdiffstats
path: root/tdeio
diff options
context:
space:
mode:
authorOBATA Akio <obache@wizdas.com>2020-08-17 18:10:50 +0900
committerTDE Gitea <gitea@mirror.git.trinitydesktop.org>2020-08-17 14:48:17 +0000
commit965a808b91b6542208b24af18e55193e5f929c37 (patch)
tree0d2782aa400a3120d5d283d927cfdcfe38e82031 /tdeio
parent6886dd7e96d475b64ac3c41a96a759c7d5fa2be9 (diff)
downloadtdelibs-965a808b91b6542208b24af18e55193e5f929c37.tar.gz
tdelibs-965a808b91b6542208b24af18e55193e5f929c37.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>
Diffstat (limited to 'tdeio')
-rw-r--r--tdeio/tdeio/connection.cpp4
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