aboutsummaryrefslogtreecommitdiffhomepage
path: root/osdep
diff options
context:
space:
mode:
authorGravatar diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-10 19:07:42 +0000
committerGravatar diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-01-10 19:07:42 +0000
commitb2c4df0543c3de1725763511eca658a055209f36 (patch)
tree618dd9e22574f0928d6c6bf09d28cf7096955e75 /osdep
parent4cb9cfc6eead9bb182159d20a425baaaf01d9927 (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
Diffstat (limited to 'osdep')
-rw-r--r--osdep/Makefile23
-rw-r--r--osdep/gettimeofday.c2
-rw-r--r--osdep/glob-win.c2
-rw-r--r--osdep/mmap_anon.c3
-rw-r--r--osdep/scandir.c3
-rw-r--r--osdep/setenv.c3
-rw-r--r--osdep/shmem.c4
-rw-r--r--osdep/strsep.c2
-rw-r--r--osdep/swab.c2
-rw-r--r--osdep/vsscanf.c2
10 files changed, 13 insertions, 33 deletions
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