os: First check for __GLIBC__ and then for PIPE_OS_BSD
authorAndreas Boll <andreas.boll.dev@gmail.com>
Wed, 11 Sep 2013 12:27:08 +0000 (14:27 +0200)
committerAndreas Boll <andreas.boll.dev@gmail.com>
Thu, 12 Sep 2013 10:35:34 +0000 (12:35 +0200)
Fixes FTBFS on kfreebsd-*

Debian GNU/kFreeBSD doesn't provide getprogname() since it uses stdlib.h
from glibc. Instead it provides program_invocation_short_name from glibc.

You can find the same order in src/mesa/drivers/dri/common/xmlconfig.c

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Tested-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/os/os_process.c

index 0557689322732b242822380307e729aefb1f111c..ef38e1d689f99616632ee024c256de9cf567ef33 100644 (file)
 
 #if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
 #  include <windows.h>
-#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
-#  include <stdlib.h>
 #elif defined(__GLIBC__)
 #  include <errno.h>
+#elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
+#  include <stdlib.h>
 #else
 #warning unexpected platform in os_process.c
 #endif
@@ -68,11 +68,11 @@ os_get_process_name(char *procname, size_t size)
 
    name = lpProcessName;
 
+#elif defined(__GLIBC__)
+   name = program_invocation_short_name;
 #elif defined(PIPE_OS_BSD) || defined(PIPE_OS_APPLE)
    /* *BSD and OS X */
    name = getprogname();
-#elif defined(__GLIBC__)
-   name = program_invocation_short_name;
 #else
 #warning unexpected platform in os_process.c
    return FALSE;