From: cwolf Date: Thu, 13 Sep 2001 23:34:46 +0000 (+0000) Subject: Conditional code for win32 environment. X-Git-Tag: v1.3.3~917 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5259c6f00630ee026c084b85ffc85e6494523224;p=platform%2Fupstream%2Flibvorbis.git Conditional code for win32 environment. svn path=/trunk/vorbis/; revision=2031 --- diff --git a/examples/chaining_example.c b/examples/chaining_example.c index 874f363..664ceee 100644 --- a/examples/chaining_example.c +++ b/examples/chaining_example.c @@ -11,17 +11,29 @@ ******************************************************************** function: illustrate simple use of chained bitstream and vorbisfile.a - last mod: $Id: chaining_example.c,v 1.10 2001/08/13 01:36:55 xiphmont Exp $ + last mod: $Id: chaining_example.c,v 1.11 2001/09/13 23:34:46 cwolf Exp $ ********************************************************************/ #include #include +#ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */ +#include +#include +#endif + int main(){ OggVorbis_File ov; int i; +#ifdef _WIN32 /* We need to set stdin/stdout to binary mode. Damn windows. */ + /* Beware the evil ifdef. We avoid these where we can, but this one we + cannot. Don't add any more, you'll probably go to hell if you do. */ + _setmode( _fileno( stdin ), _O_BINARY ); + _setmode( _fileno( stdout ), _O_BINARY ); +#endif + /* open the file/pipe on stdin */ if(ov_open(stdin,&ov,NULL,-1)<0){ printf("Could not open input as an OggVorbis file.\n\n");