From c0c9b26ff96df8dfe89c4c52c70e2c6b2e30100f Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sun, 20 Apr 2008 05:13:25 +0300 Subject: Hardcode feature checks in talloc.c Original talloc build system used autoconf to check for features, most of which were standard C headers. Assume those always exist. Always use a workaround for the one non-standard feature (strnlen). --- talloc.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/talloc.c b/talloc.c index 12b85f5a65..d63e4c61c9 100644 --- a/talloc.c +++ b/talloc.c @@ -30,6 +30,31 @@ inspired by http://swapped.cc/halloc/ */ +// Hardcode these for MPlayer assuming a working system. +// Original used autoconf detection with workarounds for broken systems. +#define HAVE_VA_COPY +#include +#include +#include +#include +#include +#include +#define MIN(a,b) ((a)<(b)?(a):(b)) +#define strnlen rep_strnlen +static size_t rep_strnlen(const char *s, size_t max) +{ + size_t len; + + for (len = 0; len < max; len++) { + if (s[len] == '\0') { + break; + } + } + return len; +} + + + #ifdef _SAMBA_BUILD_ #include "version.h" #if (SAMBA_VERSION_MAJOR<4) @@ -47,7 +72,8 @@ #endif /* _SAMBA_BUILD_ */ #ifndef _TALLOC_SAMBA3 -#include "replace.h" +// Workarounds for missing standard features, not used in MPlayer +// #include "replace.h" #include "talloc.h" #endif /* not _TALLOC_SAMBA3 */ -- cgit v1.2.3