[Mesa-dev] [PATCH] r300g: add program name check for BSD
Patrick Baggett
baggett.patrick at gmail.com
Wed Jun 26 05:21:59 PDT 2013
On Wed, Jun 26, 2013 at 2:11 AM, Jonathan Gray <jsg at jsg.id.au> wrote:
> program_invocation_short_name is glibc specific. Provide an
> alternative using getprogname(), which can be found on *BSD and OS X.
>
> Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
> ---
> src/gallium/drivers/r300/r300_chipset.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git src/gallium/drivers/r300/r300_chipset.c
> src/gallium/drivers/r300/r300_chipset.c
> index 11061ed..7f51ccb 100644
> --- src/gallium/drivers/r300/r300_chipset.c
> +++ src/gallium/drivers/r300/r300_chipset.c
> @@ -30,6 +30,14 @@
> #include <stdio.h>
> #include <errno.h>
>
> +#undef GET_PROGRAM_NAME
> +#ifdef __GLIBC__
> +# define GET_PROGRAM_NAME() program_invocation_short_name
>
I think you are missing parentheses on the end of
program_invocation_short_name
> +#else /* *BSD and OS X */
> +# include <stdlib.h>
> +# define GET_PROGRAM_NAME() getprogname()
> +#endif
> +
> /* r300_chipset: A file all to itself for deducing the various properties
> of
> * Radeons. */
>
> @@ -49,7 +57,7 @@ static void r300_apply_hyperz_blacklist(struct
> r300_capabilities* caps)
> int i;
>
> for (i = 0; i < Elements(list); i++) {
> - if (strcmp(list[i], program_invocation_short_name) == 0) {
> + if (strcmp(list[i], GET_PROGRAM_NAME()) == 0) {
> caps->zmask_ram = 0;
> caps->hiz_ram = 0;
> break;
> --
> 1.8.3.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130626/5388312f/attachment-0001.html>
More information about the mesa-dev
mailing list