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

Rob Herring robh at kernel.org
Wed Dec 20 15:54:09 UTC 2017


On Sun, Dec 17, 2017 at 4:02 PM, Maya Rashish <coypu at sdf.org> wrote:
> 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__)

Android could be added here. Android has had getprogname since
Lollipop and we don't support versions older than that. It could be a
follow-on patch too.

Rob


More information about the mesa-dev mailing list