From 7204b84beb0f5cfb166e8d56402371d05bece83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 20 Sep 2004 19:30:02 +0000 Subject: Build system improvements: - use replacement functions (macro AC_REPLACE_FUNCS and variable LTLIBOBJS), each function is in a file placed into lib/ directory, it was not necessary, but it looks nice, IMHO - headers cleanups (this was needed): - prototypes of replacement funtions and macros are placed into separate os_internal.h (and included by config.h) - drop include inttypes.h from public xine.h, replaced by custom os_type.h, idea origins from Ogg/Vorbis public headers - disable generating inttypes.h: generated replacement isn't enough for xine-lib but nobody complained (and for M$VC we have special version) - better including headers for win32, let dvdnav use its mutex wrapper - updated M$VC port Result: - xine is compiled nicely by MinGW, CygWin and paritaly M$VC - frontends in M$VC port don't require additional helping headers - moved some platform specific things from xine-utils and win32/contrib to lib/ Finally I can start with real coding. :-) CVS patchset: 6982 CVS date: 2004/09/20 19:30:02 --- lib/os_internal.h | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 lib/os_internal.h (limited to 'lib/os_internal.h') diff --git a/lib/os_internal.h b/lib/os_internal.h new file mode 100644 index 000000000..77aa7b4d0 --- /dev/null +++ b/lib/os_internal.h @@ -0,0 +1,68 @@ +#include +#include "os_types.h" + +/* replacement of strndup */ +#ifndef HAVE_STRNDUP +#define strndup(S, N) _xine_private_strndup((S), (N)) +char *_xine_private_strndup(const char *s, size_t n); +#endif + +/* replacement of basename */ +#ifndef HAVE_BASENAME +#define basename(PATH) _xine_private_basename((PATH)) +char *_xine_private_basename(char *path); +#endif + +/* replacement of hstrerror */ +#ifndef HAVE_HSTRERROR +#define hstrerror(ERR) _xine_private_hstrerror((ERR)) +const char *_xine_private_hstrerror(int err); +#endif + +/* replacement of setenv */ +#ifndef HAVE_SETENV +#define setenv(NAME, VALUE, OVERWRITE) _xine_private_setenv((NAME), (VALUE)) +int _xine_private_setenv(const char *name, const char *value); +#endif + +/* replacement of strtok_r */ +#ifndef HAVE_STRTOK_R +#define strtok_r(S, DELIM, PTRPTR) _xine_private_strtok_r((S), (DELIM), (PTRPTR)) +char *_xine_private_strtok_r(char *s, const char *delim, char **ptrptr); +#endif + +/* replacement of gettimeofday */ +#ifndef HAVE_GETTIMEOFDAY +# ifdef WIN32 +# include +# else +# include +# endif +# define gettimeofday(TV, TZ) _xine_private_gettimeofday((TV)) +int _xine_private_gettimeofday(struct timeval *tv); +#endif + +/* replacement of strpbrk */ +#ifndef HAVE_STRPBRK +#define strpbrk(S, ACCEPT) _xine_private_strpbrk((S), (ACCEPT)) +char *_xine_private_strpbrk(const char *s, const char *accept); +#endif + +/* replacement of strsep */ +#ifndef HAVE_STRSEP +#define strsep(STRINGP, DELIM) _xine_private_strsep((STRINGP), (DELIM)) +char *_xine_private_strsep(char **stringp, const char *delim); +#endif + +/* replacing lstat by stat */ +#ifndef HAVE_LSTAT +# define lstat(FILENAME, BUF) stat((FILENAME), (BUF)) +#endif + +/* macross needed for MSVC */ +#ifdef _MSC_VER +# define snprintf _snprintf +# define vsnprintf _vsnprintf +# define strcasecmp _stricmp +# define strncasecmp _strnicmp +#endif -- cgit v1.2.3