diff options
author | František Dvořák <valtri@users.sourceforge.net> | 2006-09-17 13:01:07 +0000 |
---|---|---|
committer | František Dvořák <valtri@users.sourceforge.net> | 2006-09-17 13:01:07 +0000 |
commit | 809a64d5911496a24617e3158e719e93c161e582 (patch) | |
tree | 931b908c4a47be9acae7fd6a916a0e9ae0e55847 /lib | |
parent | a4f82c060ea232d998a7d1162768b4efb9dfd67e (diff) | |
download | xine-lib-809a64d5911496a24617e3158e719e93c161e582.tar.gz xine-lib-809a64d5911496a24617e3158e719e93c161e582.tar.bz2 |
DVDNAV changes:
improve MinGW support, kFreeBSD support
define HAVE_* when provided replacement functions in xine-lib
CVS patchset: 8268
CVS date: 2006/09/17 13:01:07
Diffstat (limited to 'lib')
-rw-r--r-- | lib/os_internal.h | 90 |
1 files changed, 55 insertions, 35 deletions
diff --git a/lib/os_internal.h b/lib/os_internal.h index bffcb6ecb..c427448c4 100644 --- a/lib/os_internal.h +++ b/lib/os_internal.h @@ -34,102 +34,118 @@ /* 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); +#define 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); +#define 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); +#define 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); +#define 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); +#define 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 +# define HAVE_GETTIMEOFDAY # ifdef WIN32 # include <winsock.h> struct timezone; # else # include <sys/time.h> # endif -# define gettimeofday(TV, TZ) _xine_private_gettimeofday((TV)) -int _xine_private_gettimeofday(struct timeval *tv); +# 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); +#define 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); +#define HAVE_STRSEP +#define strsep(STRINGP, DELIM) xine_private_strsep((STRINGP), (DELIM)) +char *xine_private_strsep(char **stringp, const char *delim); #endif /* replacement of timegm */ #ifndef HAVE_TIMEGM +#define HAVE_TIMEGM #include <time.h> -#define timegm(TM) _xine_private_timegm((TM)) -time_t _xine_private_timegm(struct tm *tm); +#define timegm(TM) xine_private_timegm((TM)) +time_t xine_private_timegm(struct tm *tm); #endif /* replacement of unsetenv */ #ifndef HAVE_UNSETENV -#define unsetenv(NAME) _xine_private_unsetenv((NAME)) -void _xine_private_unsetenv(const char *name); +#define HAVE_UNSETENV +#define unsetenv(NAME) xine_private_unsetenv((NAME)) +void xine_private_unsetenv(const char *name); #endif /* replacement of asprintf & vasprintf */ #ifndef HAVE_ASPRINTF +#define HAVE_ASPRINTF #ifdef __GNUC__ - #define asprintf(STRINGPP, FORMAT, ARGS...) _xine_private_asprintf((STRINGPP), FORMAT, ##ARGS) + #define asprintf(STRINGPP, FORMAT, ARGS...) xine_private_asprintf((STRINGPP), FORMAT, ##ARGS) #elif defined (_MSC_VER) - #define asprintf(STRINGPP, FORMATARGS) _xine_private_asprintf((STRINGPP), FORMATARGS) + #define asprintf(STRINGPP, FORMATARGS) xine_private_asprintf((STRINGPP), FORMATARGS) #else - #define asprintf(STRINGPP, FORMAT, ...) _xine_private_asprintf((STRINGPP), FORMAT, __VA_ARGS__) + #define asprintf(STRINGPP, FORMAT, ...) xine_private_asprintf((STRINGPP), FORMAT, __VA_ARGS__) #endif #define vasprintf(STRINGPP, FORMAT, VA_ARG) _xine_private_vasprintf((STRINGPP), (FORMAT), (VA_ARG)) -int _xine_private_asprintf(char **string, const char *format, ...) __attribute__ ((format (printf, 2, 3))); -int _xine_private_vasprintf(char **string, const char *format, va_list ap) __attribute__ ((format (printf, 2, 0))); +int xine_private_asprintf(char **string, const char *format, ...) __attribute__ ((format (printf, 2, 3))); +int xine_private_vasprintf(char **string, const char *format, va_list ap) __attribute__ ((format (printf, 2, 0))); #endif /* 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); +#define HAVE_STRNDUP +#define strndup(S, N) xine_private_strndup((S), (N)) +char *xine_private_strndup(const char *s, size_t n); #endif /* handle non-standard function names */ #if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF) +# define HAVE_SNPRINTF # define snprintf _snprintf #endif #if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF) +# define HAVE_VSNPRINTF # define vsnprintf _vsnprintf #endif #if !defined(HAVE_STRCASECMP) && defined(HAVE__STRICMP) +# define HAVE_STRCASECMP # define strcasecmp _stricmp #endif #if !defined(HAVE_STRNCASECMP) && defined(HAVE__STRNICMP) +# define HAVE_STRNCASECMP # define strncasecmp _strnicmp #endif @@ -138,9 +154,11 @@ char *_xine_private_strndup(const char *s, size_t n); # define M_PI 3.14159265358979323846 #endif #ifndef HAVE_LRINTF +#define HAVE_LRINTF #define lrint(X) (long)((X) + ((X) >= 0 ? 0.5 : -0.5)) #endif #ifndef HAVE_RINTF +#define HAVE_RINTF #define rint(X) (int)((X) + ((X) >= 0 ? 0.5 : -0.5)) #endif @@ -226,11 +244,13 @@ char *_xine_private_strndup(const char *s, size_t n); /* replacing lstat by stat */ #ifndef HAVE_LSTAT +# define HAVE_LSTAT # define lstat(FILENAME, BUF) stat((FILENAME), (BUF)) #endif /* replacements of dirent for MSVC platform */ #ifndef HAVE_OPENDIR +#define HAVE_OPENDIR typedef struct DIR DIR; struct dirent { @@ -238,15 +258,15 @@ struct dirent { char *d_name; }; -DIR *_xine_private_opendir(const char *); -int _xine_private_closedir(DIR *); -struct dirent *_xine_private_readdir(DIR *); -void _xine_private_rewinddir(DIR *); +DIR *xine_private_opendir(const char *); +int xine_private_closedir(DIR *); +struct dirent *xine_private_readdir(DIR *); +void xine_private_rewinddir(DIR *); -#define opendir(DIRENT_NAME) _xine_private_opendir((DIRENT_NAME)) -#define closedir(DIRENT_DIR) _xine_private_closedir((DIRENT_DIR)) -#define readdir(DIRENT_DIR) _xine_private_readdir((DIRENT_DIR)) -#define rewinddir(DIRENT_DIR) _xine_private_rewinddir((DIRENT_DIR)) +#define opendir(DIRENT_NAME) xine_private_opendir((DIRENT_NAME)) +#define closedir(DIRENT_DIR) xine_private_closedir((DIRENT_DIR)) +#define readdir(DIRENT_DIR) xine_private_readdir((DIRENT_DIR)) +#define rewinddir(DIRENT_DIR) xine_private_rewinddir((DIRENT_DIR)) #endif |