From 94f33ff7e3b7140e78c014be1a68fe9c1ba17814 Mon Sep 17 00:00:00 2001 From: Juergen Keil Date: Thu, 6 Sep 2001 18:38:11 +0000 Subject: Trying to port the xine-lib sources to a non-gcc compiler CVS patchset: 584 CVS date: 2001/09/06 18:38:11 --- src/input/Makefile.am | 5 ++--- src/input/dvd_udf.c | 4 ++++ src/input/input_file.c | 6 +++++- src/libffmpeg/libavcodec/common.h | 2 +- src/libffmpeg/libavcodec/mjpeg.c | 12 +++++++++-- src/libffmpeg/libavcodec/mpeg12.c | 12 +++++++++-- src/libspudec/spu.c | 23 ++++++++++++++++----- src/libspudec/xine_decoder.c | 42 ++++++++++++++++++++++----------------- src/video_out/video_out_xshm.c | 6 +----- src/xine-engine/load_plugins.c | 6 +++++- src/xine-engine/monitor.h | 21 ++++++++++++++++++-- src/xine-engine/utils.c | 19 +++++++++--------- src/xine-engine/xine.c | 6 +++++- 13 files changed, 114 insertions(+), 50 deletions(-) (limited to 'src') diff --git a/src/input/Makefile.am b/src/input/Makefile.am index 12d21c62b..8d9546c01 100644 --- a/src/input/Makefile.am +++ b/src/input/Makefile.am @@ -2,8 +2,7 @@ ## Process this file with automake to produce Makefile.in ## -#CFLAGS += @GLOBAL_CFLAGS@ -CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64 -Wall -DXINE_COMPILE +CFLAGS = @GLOBAL_CFLAGS@ LIBTOOL = $(SHELL) $(top_builddir)/libtool-nofpic @@ -71,7 +70,7 @@ uninstall-includeHEADERS: debug: - @$(MAKE) CFLAGS="-D_FILE_OFFSET_BITS=64 -Wall -DDEBUG -g -DXINE_COMPILE" + @$(MAKE) CFLAGS="$(DEBUG_CFLAGS)" install-debug: debug @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am diff --git a/src/input/dvd_udf.c b/src/input/dvd_udf.c index c88209057..c8064b0eb 100644 --- a/src/input/dvd_udf.c +++ b/src/input/dvd_udf.c @@ -32,6 +32,10 @@ #include "dvd_udf.h" +#ifndef __GNUC__ +#define __FUNCTION__ __func__ +#endif + static int _Unicodedecode (uint8_t *data, int len, char *target); #define MAX_FILE_LEN 2048 diff --git a/src/input/input_file.c b/src/input/input_file.c index 7763c42ff..0db3d1b33 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.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: input_file.c,v 1.20 2001/08/28 23:13:08 f1rmb Exp $ + * $Id: input_file.c,v 1.21 2001/09/06 18:38:12 jkeil Exp $ */ #ifdef HAVE_CONFIG_H @@ -43,6 +43,10 @@ extern int errno; static uint32_t xine_debug; +#ifndef __GNUC__ +#define __FUNCTION__ __func__ +#endif + #define MAXFILES 65535 #ifndef NAME_MAX diff --git a/src/libffmpeg/libavcodec/common.h b/src/libffmpeg/libavcodec/common.h index aeb9ab52b..8ea58b2e7 100644 --- a/src/libffmpeg/libavcodec/common.h +++ b/src/libffmpeg/libavcodec/common.h @@ -298,7 +298,7 @@ void print_stats(void); /* misc math functions */ -extern inline int av_log2(unsigned int v) +static inline int av_log2(unsigned int v) { int n; diff --git a/src/libffmpeg/libavcodec/mjpeg.c b/src/libffmpeg/libavcodec/mjpeg.c index 1103e11d0..391ce7d23 100644 --- a/src/libffmpeg/libavcodec/mjpeg.c +++ b/src/libffmpeg/libavcodec/mjpeg.c @@ -424,9 +424,17 @@ void mjpeg_encode_mb(MpegEncContext *s, #ifndef CONFIG_WIN32 #ifdef DEBUG -#define dprintf(fmt,args...) printf(fmt, ## args) +# if __GNUC_ +# define dprintf(fmt,args...) printf(fmt, ## args) +# else +# define dprintf(...) printf(__VA_ARGS__) +# endif #else -#define dprintf(fmt,args...) +# if __GNUC__ +# define dprintf(fmt,args...) +# else +# define dprintf(...) +# endif #endif #else diff --git a/src/libffmpeg/libavcodec/mpeg12.c b/src/libffmpeg/libavcodec/mpeg12.c index f0aecd980..00183c22d 100644 --- a/src/libffmpeg/libavcodec/mpeg12.c +++ b/src/libffmpeg/libavcodec/mpeg12.c @@ -27,9 +27,17 @@ #ifndef CONFIG_WIN32 #ifdef DEBUG -#define dprintf(fmt,args...) printf(fmt, ## args) +# if __GNUC_ +# define dprintf(fmt,args...) printf(fmt, ## args) +# else +# define dprintf(...) printf(__VA_ARGS__) +# endif #else -#define dprintf(fmt,args...) +# if __GNUC__ +# define dprintf(fmt,args...) +# else +# define dprintf(...) +# endif #endif #else diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c index e0f0a4aec..b52429a4f 100644 --- a/src/libspudec/spu.c +++ b/src/libspudec/spu.c @@ -19,7 +19,7 @@ * along with this program; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * -* $Id: spu.c,v 1.10 2001/08/17 15:54:31 ehasenle Exp $ +* $Id: spu.c,v 1.11 2001/09/06 18:38:12 jkeil Exp $ * *****/ @@ -72,10 +72,23 @@ #define LOG_DEBUG 1 #ifdef DEBUG -#define LOG(lvl, fmt...) fprintf (stderr, fmt); -#else -#define LOG(lvl, fmt...) -#endif + +# ifdef __GNUC__ +# define LOG(lvl, fmt...) fprintf (stderr, fmt); +# else +# define LOG(lvl, ...) fprintf (stderr, __VA_ARGS__); +# endif + +#else /* !DEBUG */ + +# ifdef __GNUC_ +# define LOG(lvl, fmt...) +# else +# define LOG(lvl, ...) +# endif + +#endif /* !DEBUG */ + /* Return value: reassembly complete = 1 */ int spuReassembly (spu_seq_t *seq, int start, uint8_t *pkt_data, u_int pkt_len) diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c index b2dc7b793..e5f6f9232 100644 --- a/src/libspudec/xine_decoder.c +++ b/src/libspudec/xine_decoder.c @@ -19,7 +19,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: xine_decoder.c,v 1.11 2001/08/17 13:34:25 heikos Exp $ + * $Id: xine_decoder.c,v 1.12 2001/09/06 18:38:12 jkeil Exp $ * * stuff needed to turn libspu into a xine decoder plugin */ @@ -43,24 +43,30 @@ #include "video_out/alphablend.h" #include "xine-engine/bswap.h" +#ifdef __GNUC__ +#define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) {y: (_y), cr: (_cr), cb: (_cb)} +#else +#define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) { (_cb), (_cr), (_y) } +#endif + static clut_t __default_clut[] = { - {y: 0x00, cr: 0x80, cb:0x80}, - {y: 0xbf, cr: 0x80, cb:0x80}, - {y: 0x10, cr: 0x80, cb:0x80}, - {y: 0x28, cr: 0x6d, cb:0xef}, - {y: 0x51, cr: 0xef, cb:0x5a}, - {y: 0xbf, cr: 0x80, cb:0x80}, - {y: 0x36, cr: 0x80, cb:0x80}, - {y: 0x28, cr: 0x6d, cb:0xef}, - {y: 0xbf, cr: 0x80, cb:0x80}, - {y: 0x51, cr: 0x80, cb:0x80}, - {y: 0xbf, cr: 0x80, cb:0x80}, - {y: 0x10, cr: 0x80, cb:0x80}, - {y: 0x28, cr: 0x6d, cb:0xef}, - {y: 0x5c, cr: 0x80, cb:0x80}, - {y: 0xbf, cr: 0x80, cb:0x80}, - {y: 0x1c, cr: 0x80, cb:0x80}, - {y: 0x28, cr: 0x6d, cb:0xef} + CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0x10, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef), + CLUT_Y_CR_CB_INIT(0x51, 0xef, 0x5a), + CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0x36, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef), + CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0x51, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0x10, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef), + CLUT_Y_CR_CB_INIT(0x5c, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0x1c, 0x80, 0x80), + CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef) }; #define NUM_SEQ_BUFFERS 5 diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index 51be649fb..f039aa512 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.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: video_out_xshm.c,v 1.29 2001/09/01 18:11:04 jkeil Exp $ + * $Id: video_out_xshm.c,v 1.30 2001/09/06 18:38:12 jkeil Exp $ * * video_out_xshm.c, X11 shared memory extension interface for xine * @@ -449,8 +449,6 @@ static void xshm_calc_output_size (xshm_driver_t *this) { if (this->delivered_width == 0 && this->delivered_height == 0) return; /* ConfigureNotify/VisibilityNotify, no decoder output size known */ - -#if 0 /* * quick hack to allow testing of unscaled yuv2rgb conversion routines */ @@ -462,8 +460,6 @@ static void xshm_calc_output_size (xshm_driver_t *this) { this->ratio_factor = 1.0; return; } -#endif - image_ratio = (double) this->delivered_width / (double) this->delivered_height; diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 0bbd8bec0..f315a04c9 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.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: load_plugins.c,v 1.39 2001/08/23 13:27:24 jcdutton Exp $ + * $Id: load_plugins.c,v 1.40 2001/09/06 18:38:12 jkeil Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -46,6 +46,10 @@ #include "utils.h" #include "monitor.h" +#ifndef __GNUC__ +#define __FUNCTION__ __func__ +#endif + extern int errno; /** *************************************************************** diff --git a/src/xine-engine/monitor.h b/src/xine-engine/monitor.h index 38c1be91a..316e855d7 100644 --- a/src/xine-engine/monitor.h +++ b/src/xine-engine/monitor.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: monitor.h,v 1.3 2001/07/18 21:38:17 f1rmb Exp $ + * $Id: monitor.h,v 1.4 2001/09/06 18:38:12 jkeil Exp $ * * debug print and profiling functions * @@ -47,7 +47,11 @@ extern uint32_t xine_debug; #define LOOP (xine_debug & 0x8000>>11) // 16 #define GUI (xine_debug & 0x8000>>12) // 8 +#ifdef __GNUC__ #define perr(FMT,ARGS...) {fprintf(stderr, FMT, ##ARGS);fflush(stderr);} +#else /* C99 version: */ +#define perr(...) {fprintf(stderr, __VA_ARGS__);fflush(stderr);} +#endif #ifdef DEBUG @@ -57,11 +61,20 @@ extern uint32_t xine_debug; //#define perr(FMT,ARGS...) {fprintf(stderr, FMT, ##ARGS);fflush(stderr);} +#ifdef __GNUC__ #define xprintf(LVL, FMT, ARGS...) { \ if(LVL) { \ - printf(FMT, ##ARGS); \ + printf(FMT, ##ARGS); \ + } \ + } +#else /* C99 version: */ +#define xprintf(LVL, ...) { \ + if(LVL) { \ + printf(__VA_ARGS__); \ } \ } +#endif + /* * profiling */ @@ -80,7 +93,11 @@ void profiler_print_results (); //#define perr(FMT,ARGS...) +#ifdef __GNUC__ #define xprintf(LVL, FMT, ARGS...) +#else /* C99 version: */ +#define xprintf(LVL, ...) +#endif #define profiler_init() #define profiler_set_label(id, label) diff --git a/src/xine-engine/utils.c b/src/xine-engine/utils.c index 3f45e909c..5a9dc5573 100644 --- a/src/xine-engine/utils.c +++ b/src/xine-engine/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.3 2001/09/06 13:29:18 jkeil Exp $ + * $Id: utils.c,v 1.4 2001/09/06 18:38:12 jkeil Exp $ * */ #define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */ @@ -35,25 +35,26 @@ #include #include +#ifndef __GNUC__ +#define __FUNCTION__ __func__ +#endif + + /* * */ void *xmalloc(size_t size) { - void *ptrmalloc, *ptrmemset; + void *ptr; - if((ptrmalloc = malloc(size)) == NULL) { + if((ptr = malloc(size)) == NULL) { fprintf(stderr, "%s: malloc() failed: %s.\n", __FUNCTION__, strerror(errno)); return NULL; } - if((ptrmemset = memset(ptrmalloc, 0, size)) == NULL) { - fprintf(stderr, "%s: memset() failed: %s.\n", - __FUNCTION__, strerror(errno)); - return NULL; - } + memset(ptr, 0, size); - return ptrmemset; + return ptr; } /* diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 20cc1153f..8af7b3461 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.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: xine.c,v 1.57 2001/09/06 14:09:37 jkeil Exp $ + * $Id: xine.c,v 1.58 2001/09/06 18:38:12 jkeil Exp $ * * top-level xine functions * @@ -52,6 +52,10 @@ #include "monitor.h" #include "utils.h" +#ifndef __GNUC__ +#define __FUNCTION__ __func__ +#endif + /* debugging purposes only */ uint32_t xine_debug; -- cgit v1.2.3