# HG changeset patch # User michaelni # Date 1042317278 0 # Node ID 65433f1b254904ab626052b5e38a33237655b523 # Parent 3d2d2f8725f9b5afecf2a5fd19f7bc9bb4d0bdf8 os2 support patch by ("Slavik Gnatenko" ) diff -r 3d2d2f8725f9 -r 65433f1b2549 Makefile --- a/Makefile Sat Jan 11 05:33:35 2003 +0000 +++ b/Makefile Sat Jan 11 20:34:38 2003 +0000 @@ -48,14 +48,16 @@ OBJS+= ogg.o endif -LIB= libavformat.a +LIB= $(LIBPREF)avformat$(LIBSUF) all: $(LIB) $(LIB): $(OBJS) rm -f $@ $(AR) rc $@ $(OBJS) +ifneq ($(CONFIG_OS2),yes) $(RANLIB) $@ +endif installlib: all install -m 644 $(LIB) $(prefix)/lib @@ -73,4 +75,4 @@ g++ $(subst -Wall,,$(CFLAGS)) -c -o $@ $< clean: - rm -f *.o *~ *.a + rm -f *.o *~ *.a $(LIB) diff -r 3d2d2f8725f9 -r 65433f1b2549 file.c --- a/file.c Sat Jan 11 05:33:35 2003 +0000 +++ b/file.c Sat Jan 11 20:34:38 2003 +0000 @@ -42,7 +42,7 @@ } else { access = O_RDONLY; } -#ifdef CONFIG_WIN32 +#if defined(CONFIG_WIN32) || defined(CONFIG_OS2) access |= O_BINARY; #endif fd = open(filename, access, 0666); diff -r 3d2d2f8725f9 -r 65433f1b2549 img.c --- a/img.c Sat Jan 11 05:33:35 2003 +0000 +++ b/img.c Sat Jan 11 20:34:38 2003 +0000 @@ -26,9 +26,13 @@ #ifdef __BEOS__ # ifndef usleep # include -# define usleep(t) snooze((bigtime_t)(t)) +# define usleep(t) snooze((bigtime_t)(t)) # endif #endif +#if defined(CONFIG_OS2) +# include +# define usleep(t) _sleep2((t) / 1000) +#endif typedef struct { int width; diff -r 3d2d2f8725f9 -r 65433f1b2549 utils.c --- a/utils.c Sat Jan 11 05:33:35 2003 +0000 +++ b/utils.c Sat Jan 11 20:34:38 2003 +0000 @@ -18,14 +18,18 @@ */ #include "avformat.h" #include -#ifndef CONFIG_WIN32 +#ifdef CONFIG_WIN32 +#define strcasecmp _stricmp +#include +#include +#elif defined(CONFIG_OS2) +#include +#define strcasecmp stricmp +#include +#else #include #include #include -#else -#define strcasecmp _stricmp -#include -#include #endif #include @@ -362,7 +366,7 @@ } /* XXX: suppress this hack for redirectors */ -#ifndef __MINGW32__ +#ifdef CONFIG_NETWORK if (fmt == &redir_demux) { err = redir_open(ic_ptr, &ic->pb); url_fclose(&ic->pb);