[MPlayer-dev-eng] (no subject)

Trent Piepho xyzzy at speakeasy.org
Wed Feb 9 02:18:39 CET 2005


A recent change to the configure script added this to config.h:

#define HAVE_SYS_MMAN_H 1

#ifndef MAP_ANONYMOUS
#define MAP_ANONYMOUS MAP_ANON
#endif

MAP_ANONYMOUS is defined in sys/mman.h, which is only included if config.h
defines HAVE_SYS_MMAN_H.  Since config.h must be before sys/mman.h,
MAP_ANONYMOUS will never be defined and the ifndef check is pointless. 
config.h will always define MAP_ANONYMOUS, which will be re-defined when
sys/mman.h is included on systems that have MAP_ANONYMOUS (like Linux).

This patch makes configure only generate a define for MAP_ANONYMOUS if it's
needed.
-------------- next part --------------
Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.963
diff -u -r1.963 configure
--- configure	6 Feb 2005 20:56:16 -0000	1.963
+++ configure	9 Feb 2005 00:55:01 -0000
@@ -2636,6 +2636,14 @@
   _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
 fi
 
+cat > $TMPC << EOF
+#include <sys/types.h>
+#include <sys/mman.h>
+int main(void) { return MAP_ANONYMOUS; }
+EOF
+_def_mman_has_map_anonymous='#define MAP_ANONYMOUS MAP_ANON'
+cc_check && _def_mman_has_map_anonymous=''
+
 echocheck "dynamic loader"
 cat > $TMPC << EOF
 #include <dlfcn.h>
@@ -6994,10 +7002,7 @@
 /* Define this if your system has the "sys/mman.h" header file */
 $_def_mman
 $_def_mman_has_map_failed
-
-#ifndef MAP_ANONYMOUS
-#define MAP_ANONYMOUS MAP_ANON
-#endif
+$_def_mman_has_map_anonymous
 
 /* Define this if you have the elf dynamic linker -ldl library */
 $_def_dl


More information about the MPlayer-dev-eng mailing list