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
This commit is contained in:
diego 2007-01-10 19:07:42 +00:00
parent 4cb9cfc6ee
commit b2c4df0543
11 changed files with 34 additions and 33 deletions

21
configure vendored
View File

@ -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=..

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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 */

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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