setbinmode not defined if using MinGW (and MSYS)
MinGW does not, for obvious reasons, define _MSC_VER
so when trying to compile oggenc one gets an error due to undefined setbinmode.
The easiest way to fix this is to use the following patch:
--- oggenc/platform.c.orig Wed Mar 9 17:12:05 2005
+++ oggenc/platform.c Wed Mar 9 17:14:12 2005
@@ -38,7 +38,7 @@
}
#endif
-#if defined(__WATCOMC__) || defined(__BORLANDC__)
+#if defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__)
void setbinmode(FILE *f)
{
setmode(fileno(f), O_BINARY);
You can also use the patch below but that may well break things with Watcom and/or Borland:
--- oggenc/platform.c~ Wed Sep 3 10:58:04 2003
+++ oggenc/platform.c Sat Jan 1 16:50:42 2005
@@ -23,7 +23,7 @@
#include <time.h>
#endif
-#if defined(_WIN32) && defined(_MSC_VER)
+#if defined(_WIN32) //&& defined(_MSC_VER)
void setbinmode(FILE *f)
{