improve printf/warning/error on Mac OSX
This commit is contained in:
@@ -3,16 +3,32 @@
|
||||
|
||||
#include "Bullet3Common/b3Logging.h"
|
||||
|
||||
void myerrorwarningprintf(const char* msg)
|
||||
|
||||
void myerrorprintf(const char* msg)
|
||||
{
|
||||
//OutputDebugStringA(msg);
|
||||
printf(msg);
|
||||
}
|
||||
|
||||
static bool sVerboseWarning = false;
|
||||
|
||||
void mywarningprintf(const char* msg)
|
||||
{
|
||||
if (sVerboseWarning)
|
||||
{
|
||||
//OutputDebugStringA(msg);
|
||||
printf(msg);
|
||||
}
|
||||
}
|
||||
|
||||
static bool sVerbosePrintf=false;
|
||||
|
||||
void myprintf(const char* msg)
|
||||
{
|
||||
if (sVerbosePrintf)
|
||||
{
|
||||
//OutputDebugStringA(msg);
|
||||
//printf(msg);
|
||||
printf(msg);
|
||||
}
|
||||
}
|
||||
|
||||
int gArgc=0;
|
||||
@@ -30,8 +46,8 @@ int main(int argc, char **argv) {
|
||||
gArgv = argv;
|
||||
|
||||
b3SetCustomPrintfFunc(myprintf);
|
||||
b3SetCustomWarningMessageFunc(myerrorwarningprintf);
|
||||
b3SetCustomErrorMessageFunc(myerrorwarningprintf);
|
||||
b3SetCustomWarningMessageFunc(mywarningprintf);
|
||||
b3SetCustomErrorMessageFunc(myerrorprintf);
|
||||
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
||||
@@ -79,21 +79,20 @@ void MyFatalBreakAPPLE( const char * errstr ,
|
||||
size_t cb ,
|
||||
void * user_data )
|
||||
{
|
||||
b3Error("Error: %s\n", errstr);
|
||||
|
||||
|
||||
const char* patloc = strstr(errstr, "Warning");
|
||||
//find out if it is a warning or error, exit if error
|
||||
|
||||
if (patloc)
|
||||
{
|
||||
b3Warning("warning\n");
|
||||
b3Warning("Warning: %s\n", errstr);
|
||||
} else
|
||||
{
|
||||
b3Error("error\n");
|
||||
b3Error("Error: %s\n", errstr);
|
||||
b3Assert(0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef B3_USE_CLEW
|
||||
|
||||
Reference in New Issue
Block a user