-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathopennurbs_error_message.cpp
51 lines (46 loc) · 1.67 KB
/
opennurbs_error_message.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* $NoKeywords: $ */
/*
//
// Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
// McNeel & Associates.
//
// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
// MERCHANTABILITY ARE HEREBY DISCLAIMED.
//
// For complete openNURBS copyright information see <http://www.opennurbs.org>.
//
////////////////////////////////////////////////////////////////
*/
#include "opennurbs.h"
void ON_ErrorMessage(
int message_type, // 0=warning - serious problem that code is designed to handle
// 1=error - serious problem code will attempt to handle
// The thing causing the error is a bug that must
// be fixed.
// 2=assert failed - crash is nearly certain
const char* sErrorMessage
)
{
// error/warning/assert message is in sMessage[] buffer. Modify this function
// to do whatever you want to with the message.
if ( sErrorMessage && sErrorMessage[0] )
{
#if defined(ON_PURIFY_BUILD) && defined(ON_32BIT_POINTER)
// 10 December 2003 Dale Lear
// Make ON_ERROR/ON_WARNING messages show up in Purify
PurifyPrintf("%s",sErrorMessage);
#endif
#if defined(ON_OS_WINDOWS)
::OutputDebugStringA( "\n" );
::OutputDebugStringA( sErrorMessage );
::OutputDebugStringA( "\n" );
#else
#if defined(ON__DEBUG)
// not using OutputDebugStringA
printf("\n%s\n",sErrorMessage);
#endif
#endif
}
}