[MPlayer-cvslog] r21873 - in trunk: configure osdep/Makefile osdep/gettimeofday.c osdep/glob-win.c osdep/mmap_anon.c osdep/scandir.c osdep/setenv.c osdep/shmem.c osdep/strsep.c osdep/swab.c osdep/vsscanf.c

diego subversion at mplayerhq.hu
Wed Jan 10 20:07:43 CET 2007


Author: diego
Date: Wed Jan 10 20:07:42 2007
New Revision: 21873

Modified:
   trunk/configure
   trunk/osdep/Makefile
   trunk/osdep/gettimeofday.c
   trunk/osdep/glob-win.c
   trunk/osdep/mmap_anon.c
   trunk/osdep/scandir.c
   trunk/osdep/setenv.c
   trunk/osdep/shmem.c
   trunk/osdep/strsep.c
   trunk/osdep/swab.c
   trunk/osdep/vsscanf.c

Log:
Move #ifdef directives around complete files into the build system.


Modified: trunk/configure
==============================================================================
--- trunk/configure	(original)
+++ trunk/configure	Wed Jan 10 20:07:42 2007
@@ -3378,8 +3378,10 @@
 cc_check && _scandir=yes
 if test "$_scandir" = yes ; then
  _def_scandir='#define HAVE_SCANDIR 1'
+ _need_scandir=no
 else
  _def_scandir='#undef HAVE_SCANDIR'
+ _need_scandir=yes
 fi
 echores "$_scandir"
 
@@ -3393,8 +3395,10 @@
 cc_check && _strsep=yes
 if test "$_strsep" = yes ; then
  _def_strsep='#define HAVE_STRSEP 1'
+ _need_strsep=no
 else
  _def_strsep='#undef HAVE_STRSEP'
+ _need_strsep=yes
 fi
 echores "$_strsep"
 
@@ -3463,8 +3467,10 @@
 cc_check && _vsscanf=yes
 if test "$_vsscanf" = yes ; then
   _def_vsscanf='#define HAVE_VSSCANF 1'
+  _need_vsscanf=no
 else
   _def_vsscanf='#undef HAVE_VSSCANF'
+  _need_vsscanf=yes
 fi
 echores "$_vsscanf"
 
@@ -3478,8 +3484,10 @@
 cc_check && _swab=yes
 if test "$_swab" = yes ; then
   _def_swab='#define HAVE_SWAB 1'
+  _need_swab=no
 else
   _def_swab='#undef HAVE_SWAB'
+  _need_swab=yes
 fi
 echores "$_swab"
 
@@ -3529,8 +3537,10 @@
 cc_check && _glob=yes
 if test "$_glob" = yes ; then
   _def_glob='#define HAVE_GLOB 1'
+  _need_glob=no
 else
   _def_glob='#undef HAVE_GLOB'
+  _need_glob=yes
 fi
 echores "$_glob"
 
@@ -3544,8 +3554,10 @@
 cc_check && _setenv=yes
 if test "$_setenv" = yes ; then
   _def_setenv='#define HAVE_SETENV 1'
+  _need_setenv=no
 else
   _def_setenv='#undef HAVE_SETENV'
+  _need_setenv=yes
 fi
 echores "$_setenv"
 
@@ -7465,6 +7477,15 @@
 
 HAVE_XVMC_ACCEL = $_xvmc
 
+HAVE_SYS_MMAN_H = _mman
+
+NEED_GLOB    = $_need_glob
+NEED_SCANDIR = $_need_scandir
+NEED_SETENV  = $_need_setenv
+NEED_STRSEP  = $_need_strsep
+NEED_SWAB    = $_need_swab
+NEED_VSSCANF = $_need_vsscanf
+
 # for FFmpeg
 SRC_PATH=..
 BUILD_ROOT=..

Modified: trunk/osdep/Makefile
==============================================================================
--- trunk/osdep/Makefile	(original)
+++ trunk/osdep/Makefile	Wed Jan 10 20:07:42 2007
@@ -3,18 +3,21 @@
 
 LIBNAME = libosdep.a
 
-SRCS= shmem.c \
-      strsep.c \
-      strl.c \
-      vsscanf.c \
-      scandir.c \
-      gettimeofday.c \
+SRCS= strl.c \
       fseeko.c \
-      swab.c \
-      setenv.c \
-      mmap_anon.c \
 
+SRCS-$(HAVE_SYS_MMAN_H)       += mmap_anon.c
 SRCS-$(MACOSX_FINDER_SUPPORT) += macosx_finder_args.c
+ifneq ($(TARGET_OS),MINGW32)
+SRCS-$(STREAM_CACHE)          += shmem.c
+endif
+
+SRCS-$(NEED_GETTIMEOFDAY)     += gettimeofday.c
+SRCS-$(NEED_SCANDIR)          += scandir.c
+SRCS-$(NEED_SETENV)           += setenv.c
+SRCS-$(NEED_STRSEP)           += strsep.c
+SRCS-$(NEED_SWAB)             += swab.c
+SRCS-$(NEED_VSSCANF)          += vsscanf.c
 
 getch = getch2.c
 timer = timer-lx.c
@@ -26,7 +29,7 @@
 endif
 ifeq ($(TARGET_OS),MINGW32)
 getch = getch2-win.c
-SRCS += glob-win.c
+SRCS-$(NEED_GLOB)             += glob-win.c
 endif
 SRCS += $(timer)
 SRCS += $(getch)

Modified: trunk/osdep/gettimeofday.c
==============================================================================
--- trunk/osdep/gettimeofday.c	(original)
+++ trunk/osdep/gettimeofday.c	Wed Jan 10 20:07:42 2007
@@ -1,6 +1,5 @@
 #include "config.h"
 
-#ifndef HAVE_GETTIMEOFDAY
 #include <sys/time.h>
 #include <sys/timeb.h>
 void gettimeofday(struct timeval* t,void* timezone)
@@ -9,4 +8,3 @@
         t->tv_sec=timebuffer.time;
         t->tv_usec=1000*timebuffer.millitm;
 }
-#endif

Modified: trunk/osdep/glob-win.c
==============================================================================
--- trunk/osdep/glob-win.c	(original)
+++ trunk/osdep/glob-win.c	Wed Jan 10 20:07:42 2007
@@ -3,7 +3,6 @@
 
 #include "config.h"
 
-#ifndef HAVE_GLOB
 #include <windows.h>
 #include "glob.h"
 
@@ -85,4 +84,3 @@
    
    return 0;
 }
-#endif

Modified: trunk/osdep/mmap_anon.c
==============================================================================
--- trunk/osdep/mmap_anon.c	(original)
+++ trunk/osdep/mmap_anon.c	Wed Jan 10 20:07:42 2007
@@ -3,7 +3,6 @@
  * \brief Provide a compatible anonymous space mapping function
  */
 #include "config.h"
-#ifdef HAVE_SYS_MMAN_H
 
 #include <stdio.h>
 #include <unistd.h>
@@ -63,5 +62,3 @@
 
     return result;
 }
-
-#endif /* HAVE_SYS_MMAN_H */

Modified: trunk/osdep/scandir.c
==============================================================================
--- trunk/osdep/scandir.c	(original)
+++ trunk/osdep/scandir.c	Wed Jan 10 20:07:42 2007
@@ -6,8 +6,6 @@
 
 #include "config.h"
 
-#ifndef	HAVE_SCANDIR
-
 #include <sys/types.h>
 #include <dirent.h>
 #include <stdlib.h>
@@ -118,7 +116,6 @@
     }
     return -1;
 }
-#endif
 
 
 #if	STANDALONE_MAIN

Modified: trunk/osdep/setenv.c
==============================================================================
--- trunk/osdep/setenv.c	(original)
+++ trunk/osdep/setenv.c	Wed Jan 10 20:07:42 2007
@@ -2,8 +2,6 @@
 
 #include "config.h"
 
-#ifndef HAVE_SETENV
-
 #include <stdlib.h>
 #include <string.h>
 #ifndef MP_DEBUG
@@ -26,4 +24,3 @@
 
   return 0;
 }
-#endif

Modified: trunk/osdep/shmem.c
==============================================================================
--- trunk/osdep/shmem.c	(original)
+++ trunk/osdep/shmem.c	Wed Jan 10 20:07:42 2007
@@ -8,8 +8,6 @@
 
 #include "config.h"
 
-#if defined(USE_STREAM_CACHE) && !defined(WIN32)
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -116,5 +114,3 @@
       break;
   }
 }
-
-#endif

Modified: trunk/osdep/strsep.c
==============================================================================
--- trunk/osdep/strsep.c	(original)
+++ trunk/osdep/strsep.c	Wed Jan 10 20:07:42 2007
@@ -5,7 +5,6 @@
 
 #include "config.h"
 
-#ifndef HAVE_STRSEP
 char *strsep(char **stringp, const char *delim) {
   char *begin, *end;
 
@@ -39,4 +38,3 @@
  
   return begin;
 }
-#endif

Modified: trunk/osdep/swab.c
==============================================================================
--- trunk/osdep/swab.c	(original)
+++ trunk/osdep/swab.c	Wed Jan 10 20:07:42 2007
@@ -1,6 +1,5 @@
 #include "config.h"
 
-#ifndef	HAVE_SWAB
 /* system has no swab.  emulate via bswap */
 #include "mpbswap.h"
 #include <unistd.h>
@@ -14,4 +13,3 @@
     out[i] = bswap_16(in[i]);
   }
 }
-#endif

Modified: trunk/osdep/vsscanf.c
==============================================================================
--- trunk/osdep/vsscanf.c	(original)
+++ trunk/osdep/vsscanf.c	Wed Jan 10 20:07:42 2007
@@ -1,6 +1,5 @@
 #include "config.h"
 
-#ifndef	HAVE_VSSCANF
 /* system has no vsscanf.  try to provide one */
 
 #include <stdio.h>
@@ -17,4 +16,3 @@
     long p5 = va_arg(ap, long);
     return sscanf(str, format, p1, p2, p3, p4, p5);
 }
-#endif



More information about the MPlayer-cvslog mailing list