[Mesa-dev] [PATCH 1/1] Use getprogname from stdlib.h on all BSDs and APPLE

Maya Rashish coypu at sdf.org
Sun Dec 17 22:02:41 UTC 2017


Remove EOL NetBSD < 1.x (this didn't work, since we don't
include sys/param.h).
Remove EOL FreeBSD < 4.4

Functionally changes OpenBSD which now uses getprogname instead of
fallback.
---
 src/util/xmlconfig.c | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c
index 60a6331..dd97a31 100644
--- a/src/util/xmlconfig.c
+++ b/src/util/xmlconfig.c
@@ -48,19 +48,8 @@ extern char *program_invocation_name, *program_invocation_short_name;
 #    define GET_PROGRAM_NAME() program_invocation_short_name
 #elif defined(__CYGWIN__)
 #    define GET_PROGRAM_NAME() program_invocation_short_name
-#elif defined(__FreeBSD__) && (__FreeBSD__ >= 2)
-#    include <osreldate.h>
-#    if (__FreeBSD_version >= 440000)
-#        include <stdlib.h>
-#        define GET_PROGRAM_NAME() getprogname()
-#    endif
-#elif defined(__NetBSD__) && defined(__NetBSD_Version__) && (__NetBSD_Version__ >= 106000100)
-#    include <stdlib.h>
-#    define GET_PROGRAM_NAME() getprogname()
-#elif defined(__DragonFly__)
-#    include <stdlib.h>
-#    define GET_PROGRAM_NAME() getprogname()
-#elif defined(__APPLE__)
+#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
+      defined(__DragonFly__) || defined(__APPLE__)
 #    include <stdlib.h>
 #    define GET_PROGRAM_NAME() getprogname()
 #elif defined(__sun)
@@ -92,7 +81,7 @@ __getProgramName()
 #endif
 
 #if !defined(GET_PROGRAM_NAME)
-#    if defined(__OpenBSD__) || defined(NetBSD) || defined(__UCLIBC__) || defined(ANDROID)
+#    if defined(__UCLIBC__) || defined(ANDROID)
 /* This is a hack. It's said to work on OpenBSD, NetBSD and GNU.
  * Rogelio M.Serrano Jr. reported it's also working with UCLIBC. It's
  * used as a last resort, if there is no documented facility available. */
-- 
2.15.1



More information about the mesa-dev mailing list