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

Don Pellegrino udpelleg at king.mcs.drexel.edu
Fri Sep 15 00:43:39 PDT 2000



Yes mingw is great.  Thanks for the notes below.  Is there any way we could
get these changes committed to the repository?  I would be very happy if
./configure just "worked."  It would help me be less apt to be lazy about
keeping up to date with builds of vorbis if I didn't have to tweak the code
to recompile.  I know they are minor changes but still it would be one less
thing for me to worry about.

-----Original Message-----
From: owner-vorbis-dev at xiph.org [mailto:owner-vorbis-dev at xiph.org]On
Behalf Of Andy Key
Sent: Thursday, September 14, 2000 3:41 AM
To: vorbis-dev at xiph.org
Subject: Re: [vorbis-dev] PATCH - mingw compatibility for 9/13/00 build.

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.

--- >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