From: Jonathan Gray Date: Thu, 1 Sep 2016 17:12:26 +0000 (+1000) Subject: aubinator: only use program_invocation_short_name with glibc/cygwin X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d50c56f8687036fdb345d6def3262fd0929a04ad;p=mesa.git aubinator: only use program_invocation_short_name with glibc/cygwin program_invocation_short_name is a gnu extension. Limit use of it to glibc and cygwin and otherwise use getprogname() which is available on BSD and OS X. Signed-off-by: Jonathan Gray Reviewed-by: Kristian Høgsberg Reviewed-by: Emil Velikov --- diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c index df844692b05..fe1f369ec21 100644 --- a/src/intel/tools/aubinator.c +++ b/src/intel/tools/aubinator.c @@ -1014,6 +1014,12 @@ setup_pager(void) static void print_help(FILE *file) { + const char *progname; +#if defined(__GLIBC__) || defined(__CYGWIN__) + progname = program_invocation_short_name; +#else + progname = getprogname(); +#endif fprintf(file, "Usage: %s [OPTION]... FILE\n" "Decode aub file contents.\n\n" @@ -1025,7 +1031,7 @@ print_help(FILE *file) " if omitted), 'always', or 'never'\n" " --no-pager don't launch pager\n" " --no-offsets don't print instruction offsets\n", - basename(program_invocation_name)); + basename(progname)); } static bool