[vorbis-dev] PATCH - mingw compatibility for 9/13/00 build.

Andy Key scsiprog at hotmail.com
Thu Sep 14 00:41:20 PDT 2000



Hi Don,

>I am a mingw coder and I needed to make the following changes to the CVS 
>source from 9/13/00 to get a build:

Good to see someone else using mingw.

>since mingw doesn't have rint I added:
>"#define rint(x) floor((x) + 0.5)
>to my math.h

Actually, you can get it to build just fine without modifying the compiler's 
headers.  The problem is that in a lot of respects, what works for cygwin 
will also work for mingw, but the header files they use are different.  A 
macro for rint() is in lib/os.h, just needs to have the #ifdef tweaked.  I 
use:

--->>>---------------------------------------
#ifdef _WIN32
#if !defined(__GNUC__) || defined(__MINGW32__)
#  include <malloc.h>
#  define rint(x)   (floor((x)+0.5))
#endif
#endif
---<<<---------------------------------------

And in include/vorbis/os_types.h, I added a section for mingw32:

--->>>---------------------------------------
#if defined (_WIN32)
#if defined (__MINGW32__)

/* Mingw32 */
#include <_G_config.h>
typedef _G_int64_t ogg_int64_t;
typedef _G_int32_t ogg_int32_t;
typedef _G_uint32_t ogg_uint32_t;
typedef _G_int16_t ogg_int16_t;

#elif !defined(__GNUC__)
---<<<----------------------------------------

As far as psytune.c goes, just rename the floor variable in main().

-Andy Key

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.

--- >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 'vorbis-dev-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 Vorbis-dev mailing list