On Sat, Jul 04, 2009 at 02:18:52AM +0300, Pauli Nieminen wrote:
> ---
>  libdrm/xf86drm.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
> index 1e6eb7a..7b05386 100644
> --- a/libdrm/xf86drm.c
> +++ b/libdrm/xf86drm.c
> @@ -34,6 +34,7 @@
>  #ifdef HAVE_CONFIG_H
>  # include <config.h>
>  #endif
> +#define _XOPEN_SOURCE 500
>  #include <stdio.h>
>  #include <stdlib.h>
>  #include <unistd.h>

I don't think setting this directly in a source file is the correct way.
Here's an alterate patch the puts _XOPEN_SOURCE and _GNU_SOURCE in config.h
via configure.ac.  Comments?

commit 716e4ad01bac6fdb6e3f433300df3cf50116d3b1
Author: Ian Romanick <ian.d.roman...@intel.com>
Date:   Mon Jul 6 09:41:56 2009 -0700

    libdrm: Set _XOPEN_SOURCE and _GNU_SOURCE
    
    Several POSIX extensions are used in the libdrm code (e.g., mknod and ffs).
    Set _XOPEN_SOURCE to 500 and set _GNU_SOURCE to non-zero to ensure that
    prototypes for these functions are available.  This is done in configure.ac 
    that checks can eventually be added to only enable these on operating system
    that support them.
    
    This is based on a patch by Pauli Nieminen.  Thanks.
    
    Signed-off-by: Ian Romanick <ian.d.roman...@intel.com>

diff --git a/configure.ac b/configure.ac
index be2fbbf..b54e64f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,6 +145,8 @@ if test "x$HAVE_LIBUDEV" = xyes; then
 fi
 AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes])
 
+AC_DEFINE(_XOPEN_SOURCE, 500, [XOpen source])
+AC_DEFINE(_GNU_SOURCE, 1, [GNU source])
 
 AC_SUBST(WARN_CFLAGS)
 AC_OUTPUT([

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to