This is a patch for use stdin/stdout on Windows.
I confirmed this fix works with Cygwin, Mingw32, and VC++6.

--
Iwasa Kazmi
[EMAIL PROTECTED]


*** common.c.org        Sat Oct 09 15:19:21 1999
--- common.c    Sun Oct 10 16:09:54 1999
***************
*** 29,34 ****
--- 29,43 ----
  #include    "common.h"
  #include "globalflags.h"
  
+ #ifdef _WIN32
+ #include <fcntl.h>
+ #include <io.h>
+ #ifdef __CYGWIN__
+ #define _setmode setmode
+ #define _fileno fileno
+ #endif
+ #endif
+ 
  /***********************************************************************
  *
  *  Global Variable Definitions
***************
*** 383,388 ****
--- 392,400 ----
        /* Write to standard output. */
  #ifdef __EMX__
        _fsetmode(stdout,"b");
+ #endif
+ #ifdef _WIN32
+       _setmode(_fileno(stdout), _O_BINARY);
  #endif
        bs->pt = stdout;
      } else {
*** get_audio.c.org     Sat Oct 09 15:17:49 1999
--- get_audio.c Sun Oct 10 16:06:24 1999
***************
*** 7,12 ****
--- 7,21 ----
  #include <gtk/gtk.h>
  #endif
  
+ #ifdef _WIN32
+ #include <fcntl.h>
+ #include <io.h>
+ #ifdef __CYGWIN__
+ #define _setmode setmode
+ #define _fileno fileno
+ #endif
+ #endif
+ 
  static FILE *musicin=NULL;  /* input file pointer */
  static unsigned long num_samples;
  static int samp_freq;
***************
*** 401,406 ****
--- 410,418 ----
      /* Read from standard input. */
  #ifdef __EMX__
      _fsetmode(stdin,"b");
+ #endif
+ #ifdef _WIN32
+     _setmode(_fileno(stdin), _O_BINARY);
  #endif
      musicin = stdin;
    } else {



--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to