Don Pellegrino
2000-Sep-13 19:43 UTC
[vorbis-dev] PATCH - mingw compatibility for 9/13/00 build.
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: os_types.h L36C16 reads had to change "unsigned _G_int32_t" to "_G_uint32_t" to resolve the compile error: ..\include\vorbis\os_types.h:36:parse error before 'ogg_uint32_t' ..\include\vorbis\os_types.h:36:warning:data definition has no type or storage class ince mingw doesn't have rint I added: "#define rint(x) floor((x) + 0.5) to my math.h this works for all but psytune.c where floor is used as a variable name. An error occurs when using rint (or floor()) from within the same scope as the floor variable. I renamed the variable to floor_var. So perhaps the _G_uint32_t could be used instead and it would also be good if we could rename the floor variable to something else. That would get the current code compiling with mingw (as long as mingw people update their math.h, maybe that could go into a README somewhere?) --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Andy Key
2000-Sep-14 00:41 UTC
[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.hActually, 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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.