diff options
author | František Dvořák <valtri@users.sourceforge.net> | 2003-11-04 14:38:26 +0000 |
---|---|---|
committer | František Dvořák <valtri@users.sourceforge.net> | 2003-11-04 14:38:26 +0000 |
commit | cad449ce4a6de420b36a155f9da8c575307c66a1 (patch) | |
tree | 58a2ec33904072d59ac44f39562aeb592e0d5f4f /src | |
parent | bef16c72dc26ec32050c0382c92678f960dca719 (diff) | |
download | xine-lib-cad449ce4a6de420b36a155f9da8c575307c66a1.tar.gz xine-lib-cad449ce4a6de420b36a155f9da8c575307c66a1.tar.bz2 |
Final patches for compiling xine under MSVC:
- basename() is added to xine-utils, if it isn't found by configure
- macros with variable number of arguments are simplified to ignore
additional arguments (only for MSVC),
lprintf macro simplified with full functionality
- minor update for building a52, some preparation for ffmpeg
CVS patchset: 5687
CVS date: 2003/11/04 14:38:26
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-engine/input_rip.c | 3 | ||||
-rw-r--r-- | src/xine-utils/utils.c | 43 | ||||
-rw-r--r-- | src/xine-utils/xineutils.h | 45 |
3 files changed, 74 insertions, 17 deletions
diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c index 3365a9ce1..60c6491b2 100644 --- a/src/xine-engine/input_rip.c +++ b/src/xine-engine/input_rip.c @@ -29,7 +29,7 @@ * - it's possible speeder saving streams in the xine without playing: * xine stream_mrl#save:file.raw\;noaudio\;novideo * - * $Id: input_rip.c,v 1.10 2003/11/02 14:12:52 valtri Exp $ + * $Id: input_rip.c,v 1.11 2003/11/04 14:38:26 valtri Exp $ */ /* TODO: @@ -46,7 +46,6 @@ #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> -#include <libgen.h> #include <stdio.h> #include <string.h> diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index b3286c11a..be5220231 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: utils.c,v 1.18 2003/09/16 02:11:45 storri Exp $ + * $Id: utils.c,v 1.19 2003/11/04 14:38:26 valtri Exp $ * */ #define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */ @@ -200,3 +200,44 @@ void xine_hexdump (char *buf, int length) { printf("-"); printf("\n"); } + + +#ifndef HAVE_BASENAME + +#define FILESYSTEM_PREFIX_LEN(filename) 0 +#define ISSLASH(C) ((C) == '/') + +/* + * get base name + * + * (adopted from sh-utils) + */ +char *basename (char const *name) { + char const *base = name + FILESYSTEM_PREFIX_LEN (name); + char const *p; + + for (p = base; *p; p++) + { + if (ISSLASH (*p)) + { + /* Treat multiple adjacent slashes like a single slash. */ + do p++; + while (ISSLASH (*p)); + + /* If the file name ends in slash, use the trailing slash as + the basename if no non-slashes have been found. */ + if (! *p) + { + if (ISSLASH (*base)) + base = p - 1; + break; + } + + /* *P is a non-slash preceded by a slash. */ + base = p; + } + } + + return (char *) base; +} +#endif diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h index 6e4900b30..91e4e0d7a 100644 --- a/src/xine-utils/xineutils.h +++ b/src/xine-utils/xineutils.h @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xineutils.h,v 1.62 2003/11/01 17:25:49 mroi Exp $ + * $Id: xineutils.h,v 1.63 2003/11/04 14:38:26 valtri Exp $ * */ #ifndef XINEUTILS_H @@ -33,6 +33,9 @@ extern "C" { #include <stdarg.h> #include <inttypes.h> #include <pthread.h> +#if HAVE_LIBGEN_H +# include <libgen.h> +#endif #ifdef XINE_COMPILE # include "attributes.h" @@ -907,24 +910,18 @@ void xine_print_trace(void); #endif /* LOG_VERBOSE */ #ifdef LOG - #ifdef __GNUC__ - #define lprintf(fmt, args...) \ - do{ \ - LONG_LOG_MODULE_STRING \ - printf( fmt, ##args ); \ - }while(0) - #else - #define lprintf(...) \ - do{ \ - LONG_LOG_MODULE_STRING \ - printf( __VA_ARGS__ ); \ - }while(0) - #endif /* __GNUC__ */ + #define lprintf \ + LONG_LOG_MODULE_STRING \ + printf #else #ifdef __GNUC__ #define lprintf(fmt, args...) ; #else + #ifdef _MSC_VER + #define lprintf + #else #define lprintf(...) ; + #endif /* _MSC_VER */ #endif /* __GNUC__ */ #endif /* LOG */ @@ -937,6 +934,15 @@ void xine_print_trace(void); } \ }while(0) #else +#ifdef _MSC_VER + #define llprintf(cat, fmtargs) \ + do{ \ + if(cat){ \ + LONG_LOG_MODULE_STRING \ + printf( "%s", fmtargs ); \ + } \ + }while(0) +#else #define llprintf(cat, ...) \ do{ \ if(cat){ \ @@ -944,6 +950,7 @@ void xine_print_trace(void); printf( __VA_ARGS__ ); \ } \ }while(0) +#endif /* _MSC_VER */ #endif /* __GNUC__ */ #ifdef __GNUC__ @@ -955,6 +962,15 @@ void xine_print_trace(void); } \ } while(0) #else +#ifdef _MSC_VER + #define xprintf(xine, verbose, fmtargs) \ + do { \ + if((xine)->verbosity >= verbose){ \ + LOG_MODULE_STRING \ + printf("%s", fmtargs); \ + } \ + } while(0) +#else #define xprintf(xine, verbose, ...) \ do { \ if((xine)->verbosity >= verbose){ \ @@ -962,6 +978,7 @@ void xine_print_trace(void); printf(__VA_ARGS__); \ } \ } while(0) +#endif /* _MSC_VER */ #endif /* __GNUC__ */ /* time measuring macros for profiling tasks */ |