[Mesa-dev] [PATCH 3/3] aubinator: only use program_invocation_short_name with glibc/cygwin
Kristian Høgsberg
hoegsberg at gmail.com
Thu Sep 1 17:27:46 UTC 2016
On Thu, Sep 1, 2016 at 10:12 AM, Jonathan Gray <jsg at jsg.id.au> wrote:
> 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 <jsg at jsg.id.au>
For the series,
Reviewed-by: Kristian Høgsberg <krh at bitplanet.net>
> ---
> src/intel/tools/aubinator.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
> index df84469..fe1f369 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
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list