PDA

View Full Version : Compiler question


a_troll_01
12-27-2007, 12:28 AM
I haven't done any C/C++ development in years and so I'm looking for a good free or open source Windows compiler that can be used to build EMU. Any suggestions?

BTW - I downloaded the Microsoft 2008 Express compiler and it puked all over a redef of vsprintf. I really don't want to have to fiddle with #define statements each time there is a new EMU release.

Thanks

sfisque
12-27-2007, 05:03 AM
well, since eqemu builds with gcc, you could try installing cygwin (if you dont already have it) and maybe building using its gcc. not sure if it will explode, but worthy of an attempt if you're sold on windows.

== sfisque

a_troll_01
12-28-2007, 02:12 AM
I tracked down the issue and it appears to be one of symantics. The EMU projects references the functions _snprintf & _vsnprintf and MSC uses _snprintf_c & _vsnprintf_c.

So I made the following change:
#ifdef WIN32
#ifdef _MSC_VER
#define snprintf _snprintf_c
#define vsnprintf _vsnprintf_c
#else
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif

I do have a question about the project structure. Why do we redefine snprintf & vsnprintf in the source so many times? Seems to me it would have be more appropriate to define it once in types.h and then include types.h where needed.