diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-01-10 19:07:42 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-01-10 19:07:42 +0000 |
commit | b2c4df0543c3de1725763511eca658a055209f36 (patch) | |
tree | 618dd9e22574f0928d6c6bf09d28cf7096955e75 | |
parent | 4cb9cfc6eead9bb182159d20a425baaaf01d9927 (diff) |
Move #ifdef directives around complete files into the build system.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21873 b3059339-0415-0410-9bf9-f77b7e298cf2
-rwxr-xr-x | configure | 21 | ||||
-rw-r--r-- | osdep/Makefile | 23 | ||||
-rw-r--r-- | osdep/gettimeofday.c | 2 | ||||
-rw-r--r-- | osdep/glob-win.c | 2 | ||||
-rw-r--r-- | osdep/mmap_anon.c | 3 | ||||
-rw-r--r-- | osdep/scandir.c | 3 | ||||
-rw-r--r-- | osdep/setenv.c | 3 | ||||
-rw-r--r-- | osdep/shmem.c | 4 | ||||
-rw-r--r-- | osdep/strsep.c | 2 | ||||
-rw-r--r-- | osdep/swab.c | 2 | ||||
-rw-r--r-- | osdep/vsscanf.c | 2 |
11 files changed, 34 insertions, 33 deletions
@@ -3378,8 +3378,10 @@ _scandir=no 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 @@ _strsep=no 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 @@ _vsscanf=no 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 @@ _swab=no 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 @@ _glob=no 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 @@ _setenv=no 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_PTHREADS = $_pthreads 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=.. diff --git a/osdep/Makefile b/osdep/Makefile index 0040ffd4ad..9865581623 100644 --- a/osdep/Makefile +++ b/osdep/Makefile @@ -3,18 +3,21 @@ include ../config.mak 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 @@ timer = timer-darwin.c endif ifeq ($(TARGET_OS),MINGW32) getch = getch2-win.c -SRCS += glob-win.c +SRCS-$(NEED_GLOB) += glob-win.c endif SRCS += $(timer) SRCS += $(getch) diff --git a/osdep/gettimeofday.c b/osdep/gettimeofday.c index 860eb388e7..7436898121 100644 --- a/osdep/gettimeofday.c +++ b/osdep/gettimeofday.c @@ -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 @@ void gettimeofday(struct timeval* t,void* timezone) t->tv_sec=timebuffer.time; t->tv_usec=1000*timebuffer.millitm; } -#endif diff --git a/osdep/glob-win.c b/osdep/glob-win.c index 5e77771331..9a0c92a278 100644 --- a/osdep/glob-win.c +++ b/osdep/glob-win.c @@ -3,7 +3,6 @@ #include "config.h" -#ifndef HAVE_GLOB #include <windows.h> #include "glob.h" @@ -85,4 +84,3 @@ int main(){ return 0; } -#endif diff --git a/osdep/mmap_anon.c b/osdep/mmap_anon.c index 89dcda8b88..cf90f2179a 100644 --- a/osdep/mmap_anon.c +++ b/osdep/mmap_anon.c @@ -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 @@ void *mmap_anon(void *addr, size_t len, int prot, int flags, off_t offset) return result; } - -#endif /* HAVE_SYS_MMAN_H */ diff --git a/osdep/scandir.c b/osdep/scandir.c index 739e65571a..4d2e7556c3 100644 --- a/osdep/scandir.c +++ b/osdep/scandir.c @@ -6,8 +6,6 @@ #include "config.h" -#ifndef HAVE_SCANDIR - #include <sys/types.h> #include <dirent.h> #include <stdlib.h> @@ -118,7 +116,6 @@ error: } return -1; } -#endif #if STANDALONE_MAIN diff --git a/osdep/setenv.c b/osdep/setenv.c index 8279f6c962..1dd6c4828e 100644 --- a/osdep/setenv.c +++ b/osdep/setenv.c @@ -2,8 +2,6 @@ #include "config.h" -#ifndef HAVE_SETENV - #include <stdlib.h> #include <string.h> #ifndef MP_DEBUG @@ -26,4 +24,3 @@ int setenv(const char *name, const char *val, int overwrite) return 0; } -#endif diff --git a/osdep/shmem.c b/osdep/shmem.c index 4ab04c07ae..24e3310ccb 100644 --- a/osdep/shmem.c +++ b/osdep/shmem.c @@ -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 @@ void shmem_free(void* p,int size){ break; } } - -#endif diff --git a/osdep/strsep.c b/osdep/strsep.c index 51e16c3599..85bb8b5749 100644 --- a/osdep/strsep.c +++ b/osdep/strsep.c @@ -5,7 +5,6 @@ #include "config.h" -#ifndef HAVE_STRSEP char *strsep(char **stringp, const char *delim) { char *begin, *end; @@ -39,4 +38,3 @@ char *strsep(char **stringp, const char *delim) { return begin; } -#endif diff --git a/osdep/swab.c b/osdep/swab.c index cf8efe6bee..46da22c744 100644 --- a/osdep/swab.c +++ b/osdep/swab.c @@ -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 @@ void swab(const void *from, void *to, ssize_t n) { out[i] = bswap_16(in[i]); } } -#endif diff --git a/osdep/vsscanf.c b/osdep/vsscanf.c index 0252ac287f..8a7ccf98b7 100644 --- a/osdep/vsscanf.c +++ b/osdep/vsscanf.c @@ -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 @@ vsscanf(const char *str, const char *format, va_list ap) long p5 = va_arg(ap, long); return sscanf(str, format, p1, p2, p3, p4, p5); } -#endif |