2323#include < ode/config.h>
2424#include < ode/error.h>
2525
26- #pragma warning(disable:4996)
2726
2827static dMessageFunction *error_function = 0 ;
2928static dMessageFunction *debug_function = 0 ;
@@ -120,10 +119,17 @@ extern "C" void dMessage (int num, const char *msg, ...)
120119
121120#ifdef WIN32
122121
122+ // isn't cygwin annoying!
123+ #ifdef CYGWIN
124+ #define _snprintf snprintf
125+ #define _vsnprintf vsnprintf
126+ #endif
127+
128+
123129#include " windows.h"
124130
125- // #ifdef _DEBUG_
126- void _cdecl dError (int num, const char *msg, ...)
131+
132+ extern " C " void dError (int num, const char *msg, ...)
127133{
128134 va_list ap;
129135 va_start (ap,msg);
@@ -139,29 +145,29 @@ void _cdecl dError (int num, const char *msg, ...)
139145}
140146
141147
142- void _cdecl dDebug (int num, const char *msg, ...)
148+ extern " C " void dDebug (int num, const char *msg, ...)
143149{
144150 va_list ap;
145151 va_start (ap,msg);
146152 if (debug_function) debug_function (num,msg,ap);
147153 else {
148154 char s[1000 ],title[100 ];
149- _snprintf (title,sizeof (title)," ODE INTERNAL ERROR %d" ,num);
150- _vsnprintf (s,sizeof (s),msg,ap);
155+ _snprintf (title,sizeof (title)," ODE INTERNAL ERROR %d" ,num);
156+ _vsnprintf (s,sizeof (s),msg,ap);
151157 s[sizeof (s)-1 ] = 0 ;
152158 MessageBox (0 ,s,title,MB_OK | MB_ICONSTOP);
153159 }
154160 abort ();
155161}
156162
157- void _cdecl dMessage (int num, const char *msg, ...)
163+
164+ extern " C" void dMessage (int num, const char *msg, ...)
158165{
159166 va_list ap;
160167 va_start (ap,msg);
161168 if (message_function) message_function (num,msg,ap);
162169 else printMessage (num," ODE Message" ,msg,ap);
163170}
164- // #endif
165171
166172
167173#endif
0 commit comments