[xiph-cvs] cvs commit: vorbis-tools/oggenc audio.c oggenc.dsp platform.c platform.h
Michael Smith
msmith at xiph.org
Sat Dec 23 22:17:41 PST 2000
msmith 00/12/23 22:17:41
Modified: oggenc audio.c oggenc.dsp platform.c platform.h
Log:
Portability fixes for OS/2, win32, solaris. And untested project file updates for win32.
Revision Changes Path
1.6 +1 -0 vorbis-tools/oggenc/audio.c
Index: audio.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/audio.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- audio.c 2000/11/30 06:04:45 1.5
+++ audio.c 2000/12/24 06:17:40 1.6
@@ -15,6 +15,7 @@
#include <string.h>
#include <sys/types.h>
#include "audio.h"
+#include "platform.h"
#define WAV_HEADER_SIZE 44
1.2 +1 -1 vorbis-tools/oggenc/oggenc.dsp
Index: oggenc.dsp
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/oggenc.dsp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- oggenc.dsp 2000/11/18 03:47:35 1.1
+++ oggenc.dsp 2000/12/24 06:17:40 1.2
@@ -103,7 +103,7 @@
# End Source File
# Begin Source File
-SOURCE=.\oe_win32.c
+SOURCE=.\platform.c
# End Source File
# Begin Source File
1.2 +13 -3 vorbis-tools/oggenc/platform.c
Index: platform.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/platform.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- platform.c 2000/11/30 06:33:36 1.1
+++ platform.c 2000/12/24 06:17:40 1.2
@@ -15,13 +15,13 @@
#include "platform.h"
#include "encode.h"
#include <stdlib.h>
-#if defined(_WIN32) || defined(__EMX__)
+#if defined(_WIN32) || defined(__EMX__) || defined(__WATCOMC__)
#include <fcntl.h>
#include <io.h>
#include <time.h>
#endif
-#ifdef _WIN32
+#if defined(_WIN32) || defined(__WATCOMC__)
/* This doesn't seem to exist on windows */
char *rindex(char *s, int c)
{
@@ -35,7 +35,10 @@
}
return ret;
}
+#endif
+#ifdef _WIN32
+
void setbinmode(FILE *f)
{
_setmode( _fileno(f), _O_BINARY );
@@ -49,8 +52,15 @@
}
#endif
+#ifdef __WATCOMC__
+void setbinmode(FILE *f)
+{
+ setmode(fileno(f), O_BINARY);
+}
+#endif
+
-#if defined(_WIN32) || defined(__EMX__)
+#if defined(_WIN32) || defined(__EMX__) || defined(__WATCOMC__)
void *timer_start(void)
{
time_t *start = malloc(sizeof(time_t));
1.2 +13 -2 vorbis-tools/oggenc/platform.h
Index: platform.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/oggenc/platform.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- platform.h 2000/09/07 00:57:47 1.1
+++ platform.h 2000/12/24 06:17:40 1.2
@@ -3,14 +3,25 @@
#include <stdio.h>
-#ifdef _WIN32
+#ifdef __sun__ /* Right way to do this? */
+#include <alloca.h>
+#endif
+#ifdef __OS2__
+#define INCL_DOS
+#define INCL_NOPMAPI
+#include <os2.h>
+#endif
+
+#if defined(_WIN32) || defined(__OS2__)
+#include <malloc.h>
+
char *rindex(char *s, int c);
void setbinmode(FILE *);
#else /* Unix, mostly */
-#define setbinmode(x)
+#define setbinmode(x) {}
#endif
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the commits
mailing list