Initialize libbullet git in 2.0_beta.
[platform/upstream/libbullet.git] / Extras / RigidBodyGpuPipeline / dynamics / basic_demo / Stubs / AdlError.h
1 /*
2 Copyright (c) 2012 Advanced Micro Devices, Inc.  
3
4 This software is provided 'as-is', without any express or implied warranty.
5 In no event will the authors be held liable for any damages arising from the use of this software.
6 Permission is granted to anyone to use this software for any purpose, 
7 including commercial applications, and to alter it and redistribute it freely, 
8 subject to the following restrictions:
9
10 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
11 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
12 3. This notice may not be removed or altered from any source distribution.
13 */
14 //Originally written by Takahiro Harada
15
16
17 #ifndef CL_ERROR_H
18 #define CL_ERROR_H
19
20 #ifdef DX11RENDER
21 #include <windows.h>
22 #endif
23
24 #ifdef _DEBUG
25         #include <assert.h>
26         #define CLASSERT(x) if(!(x)){__debugbreak(); }
27         #define ADLASSERT(x) if(!(x)){__debugbreak(); }
28 #else
29         #define CLASSERT(x) if(x){}
30         #define ADLASSERT(x) if(x){}
31
32 #endif
33
34
35
36
37 #ifdef _DEBUG
38         #define COMPILE_TIME_ASSERT(x) {int compileTimeAssertFailed[x]; compileTimeAssertFailed[0];}
39 #else
40         #define COMPILE_TIME_ASSERT(x)
41 #endif
42
43 #ifdef _DEBUG
44         #include <stdarg.h>
45         #include <stdio.h>
46         __inline
47         void debugPrintf(const char *fmt, ...)
48         {
49                 va_list arg;
50                 va_start(arg, fmt);
51 #ifdef DX11RENDER
52                 char buf[256];
53                 vsprintf_s( buf, 256, fmt, arg );
54 #ifdef UNICODE
55                 WCHAR wbuf[256];
56                 int sizeWide = MultiByteToWideChar(0,0,buf,-1,wbuf,0);
57                 MultiByteToWideChar(0,0,buf,-1,wbuf,sizeWide);
58
59 //              swprintf_s( wbuf, 256, L"%s", buf );
60                 OutputDebugString( wbuf );
61 #else
62                 OutputDebugString( buf );
63 #endif
64 #else
65                 vprintf(fmt, arg);
66 #endif
67                 va_end(arg);
68         }
69 #else
70         __inline
71         void debugPrintf(const char *fmt, ...)
72         {
73         }
74 #endif
75
76
77 #define WARN(msg) debugPrintf("WARNING: %s\n", msg);
78
79 #endif
80