1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     assert.h
4 
5   Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Revision: 23685 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NW_ASSERT_H_
17 #define NW_ASSERT_H_
18 
19 #include <nw/config.h>
20 #include <nw/os/os_Utility.h>
21 
22 //#ifndef NW_FROM_TOOL
23 //    #include <nw/db/assert.h>
24 //#endif
25 
26 #include <limits.h>
27 
28 #if !defined(NW_RELEASE)
29   #define NW_ASSERTION_ENABLE
30 
31   #if !defined(NW_WARNING_DISABLE)
32     #define NW_WARNING_ENABLE
33   #endif
34 #endif
35 
36 //--------------------------------------------------------------------------------
37 //  コンパイル時チェック
38 //
39 #define NW_COMPILER_ASSERT(expr) \
40     extern void nw4r_compiler_assert ## __LINE__ ( char is[(expr) ? +1 : -1] )
41 
42 namespace nw
43 {
44 namespace internal
45 {
46 template<bool> struct static_assert;
47 template<> struct static_assert<true> {};
48 template<int> struct static_check {};
49 } // namespace internal
50 } // namespace nw
51 
52 //! クラス内にも配置できるコンパイル時アサーションです。
53 #define NW_STATIC_ASSERT(expr) \
54     typedef nw::internal::static_check<sizeof(nw::internal::static_assert<expr>)> STATIC_ASSERT_FAILED
55 
56 
57 //--------------------------------------------------------------------------------
58 //  Assert message
59 //
60 //#ifndef NW_ASSERTMSG
61 //#ifdef  NW_FROM_TOOL
62 // #define NW_ASSERTMSG(exp, ... )  ((void)0)
63 //#else
64 //#define NW_ASSERTMSG  NW_DB_ASSERTMSG
65 //#endif
66 //#endif
67 
68 #if !defined( NW_ASSERTION_ENABLE )
69 #define NW_ASSERTMSG(exp, ... ) ((void)0)
70 #else
71 #define NW_ASSERTMSG(exp, ... ) (void) ((exp) || (nwosPanic(__VA_ARGS__), 0))
72 #endif
73 
74 
75 
76 //--------------------------------------------------------------------------------
77 //  Assert
78 //
79 #ifndef NW_ASSERT
80 #define NW_ASSERT(exp) \
81             NW_ASSERTMSG( (exp), "NW:Failed assertion " #exp )
82 #endif
83 
84 //--------------------------------------------------------------------------------
85 //  NULL Assert
86 //
87 #ifndef NW_NULL_ASSERT
88 #define NW_NULL_ASSERT(exp) \
89             NW_ASSERTMSG( (exp) != NULL, "NW:Pointer must not be NULL ("#exp")" )
90 #endif
91 
92 //--------------------------------------------------------------------------------
93 //  Min Assert
94 //
95 #ifndef NW_MIN_ASSERT
96 #define NW_MIN_ASSERT(exp, min) \
97             NW_ASSERTMSG( (exp) >= (min), #exp " is out of bounds(%d)\n%d <= "#exp" not satisfied.", static_cast<int>(exp), static_cast<int>(min) )
98 #endif
99 
100 //--------------------------------------------------------------------------------
101 //  Max Assert
102 //
103 #ifndef NW_MAX_ASSERT
104 #define NW_MAX_ASSERT(exp, max) \
105             NW_ASSERTMSG( (exp) <= (max), #exp " is out of bounds(%d)\n"#exp" <= %d not satisfied.", static_cast<int>(exp), static_cast<int>(max) )
106 #endif
107 
108 //--------------------------------------------------------------------------------
109 //  Min Max Assert
110 //
111 #ifndef NW_MINMAX_ASSERT
112 #define NW_MINMAX_ASSERT(exp, min, max) \
113             NW_ASSERTMSG( (exp) >= (min) && (exp) <= (max), #exp " is out of bounds(%d)\n%d <= "#exp" <= %d not satisfied.", static_cast<int>(exp), static_cast<int>(min), static_cast<int>(max))
114 #endif
115 
116 //--------------------------------------------------------------------------------
117 //  Min Max Less Than Assert
118 //
119 #ifndef NW_MINMAXLT_ASSERT
120 #define NW_MINMAXLT_ASSERT(exp, min, max) \
121             NW_ASSERTMSG( (exp) >= (min) && (exp) < (max), #exp " is out of bounds(%d)\n%d <= "#exp" < %d not satisfied.", static_cast<int>(exp), static_cast<int>(min), static_cast<int>(max))
122 #endif
123 
124 //--------------------------------------------------------------------------------
125 //  Min Assert for floating point value
126 //
127 #ifndef NW_FMIN_ASSERT
128 #define NW_FMIN_ASSERT(exp, min) \
129             NW_ASSERTMSG( (exp) >= (min), #exp " is out of bounds(%f)\n%f <= "#exp" not satisfied.", static_cast<double>(exp), static_cast<double>(min) )
130 #endif
131 
132 //--------------------------------------------------------------------------------
133 //  Max Assert for floating point value
134 //
135 #ifndef NW_FMAX_ASSERT
136 #define NW_FMAX_ASSERT(exp, max) \
137             NW_ASSERTMSG( (exp) <= (max), #exp " is out of bounds(%f)\n"#exp" <= %f not satisfied.", static_cast<double>(exp), static_cast<double>(max) )
138 #endif
139 
140 //--------------------------------------------------------------------------------
141 //  Min Max Assert for floating point value
142 //
143 #ifndef NW_FMINMAX_ASSERT
144 #define NW_FMINMAX_ASSERT(exp, min, max) \
145             NW_ASSERTMSG( (exp) >= (min) && (exp) <= (max), #exp " is out of bounds(%f)\n%f <= "#exp" <= %f not satisfied.", static_cast<double>(exp), static_cast<double>(min), static_cast<double>(max))
146 #endif
147 
148 //--------------------------------------------------------------------------------
149 //  Fatal error
150 //
151 #ifndef NW_FATAL_ERROR
152 #ifdef  NW_FROM_TOOL
153 #define NW_FATAL_ERROR    true ? 0:
154 #else
155 #define NW_FATAL_ERROR(...) \
156             NW_ASSERTMSG( false, "NW:Fatal Error\n"__VA_ARGS__ )
157 #endif
158 #endif
159 
160 //--------------------------------------------------------------------------------
161 //  Internal error
162 //
163 #ifndef NW_INTERNAL_ERROR
164 #ifdef  NW_FROM_TOOL
165 #define NW_INTERNAL_ERROR true ? 0:
166 #else
167 #define NW_INTERNAL_ERROR(...) \
168             NW_ASSERTMSG( false, "NW Internal error\n" __VA_ARGS__ )
169 #endif
170 #endif
171 
172 
173 //--------------------------------------------------------------------------------
174 //  Cache Alignment error
175 //
176 #ifndef NW_CACHE_ALIGN_ASSERT
177 #if defined( NW_PLATFORM_GC )
178 #define NW_CACHE_ALIGN_ASSERT     NW_ALIGN32_ASSERT
179 #else
180 #define NW_CACHE_ALIGN_ASSERT     NW_ALIGN32_ASSERT
181 #endif
182 #endif
183 
184 
185 //--------------------------------------------------------------------------------
186 //  Alignment error
187 //
188 #ifndef NW_ALIGN_ASSERT
189 #define NW_ALIGN_ASSERT(exp,align) \
190     NW_ASSERTMSG( (NW_ANY_TO_PTR_VALUE(exp) & ((align) - 1)) == 0, "NW:Alignment Error(0x%x)\n"#exp" must be aligned to %d bytes boundary.", exp, align )
191 #endif
192 
193 //--------------------------------------------------------------------------------
194 //  Alignment error(128 bytes)
195 //
196 #ifndef NW_ALIGN128_ASSERT
197 #define NW_ALIGN128_ASSERT(exp) \
198              NW_ALIGN_ASSERT( (exp), 128 )
199 #endif
200 
201 //--------------------------------------------------------------------------------
202 //  Alignment error(32 bytes)
203 //
204 #ifndef NW_ALIGN32_ASSERT
205 #define NW_ALIGN32_ASSERT(exp) \
206              NW_ALIGN_ASSERT( (exp), 32 )
207 #endif
208 
209 //--------------------------------------------------------------------------------
210 //  Alignment error(4 bytes)
211 //
212 #ifndef NW_ALIGN4_ASSERT
213 #define NW_ALIGN4_ASSERT(exp) \
214              NW_ALIGN_ASSERT( (exp), 4 )
215 #endif
216 
217 //--------------------------------------------------------------------------------
218 //  Alignment error(2 bytes)
219 //
220 #ifndef NW_ALIGN2_ASSERT
221 #define NW_ALIGN2_ASSERT(exp) \
222              NW_ALIGN_ASSERT( (exp), 2 )
223 #endif
224 
225 //--------------------------------------------------------------------------------
226 //  buffer size error
227 //
228 #ifndef NW_BUFFERSIZE_ASSERT
229 #ifdef  NW_PLATFORM_RVL
230 #define NW_BUFFERSIZE_ASSERT(exp) \
231             NW_ASSERTMSG( (exp) <= 64 * 1024 * 1024, "NW:Buffer Size Error\n" #exp "(=%d) over maximum physical memory size.", (exp))
232 #else
233 #define NW_BUFFERSIZE_ASSERT(exp) \
234             NW_ASSERTMSG( (exp) <= 24 * 1024 * 1024, "NW:Buffer Size Error\n" #exp "(=%d) over maximum physical memory size.", (exp))
235 #endif
236 #endif
237 
238 //--------------------------------------------------------------------------------
239 //  Invalid pointer error
240 //
241 #ifndef NW_POINTER_ASSERT
242 #if defined(NW_PLATFORM_CTRWIN) || defined(NW_PLATFORM_CTR)
243 #define NW_POINTER_ASSERT(exp)                                                                                            \
244             NW_ASSERTMSG(                                                                                                 \
245                 NW_ANY_TO_PTR_VALUE(exp) != 0,                                                                            \
246                 "NW:Pointer Error\n"#exp"(=%p) is not valid pointer.", (exp) )
247 #elif   defined(NW_PLATFORM_RVL)
248 #define NW_POINTER_ASSERT(exp)                                                                                            \
249             NW_ASSERTMSG(                                                                                                 \
250                    ((NW_ANY_TO_PTR_VALUE(exp) & 0xFF000000) == 0x80000000)    /* 8000_0000~80FF_FFFF MEM1 Cached   */    \
251                 || ((NW_ANY_TO_PTR_VALUE(exp) & 0xFF800000) == 0x81000000)    /* 8100_0000~817F_FFFF MEM1 Cached   */    \
252                 || ((NW_ANY_TO_PTR_VALUE(exp) & 0xF8000000) == 0x90000000)    /* 9000_0000~97FF_FFFF MEM2 Cached   */    \
253                 || ((NW_ANY_TO_PTR_VALUE(exp) & 0xFF000000) == 0xC0000000)    /* C000_0000~C0FF_FFFF MEM1 Uncached */    \
254                 || ((NW_ANY_TO_PTR_VALUE(exp) & 0xFF800000) == 0xC1000000)    /* C100_0000~C17F_FFFF MEM1 Uncached */    \
255                 || ((NW_ANY_TO_PTR_VALUE(exp) & 0xF8000000) == 0xD0000000)    /* D000_0000~D7FF_FFFF MEM2 Uncached */    \
256                 || ((NW_ANY_TO_PTR_VALUE(exp) & 0xFFFFC000) == 0xE0000000),   /* E000_0000~E000_3FFF Locked Cache  */    \
257                 "NW:Pointer Error\n"#exp"(=%p) is not valid pointer.", (exp) )
258 #else
259 #define NW_POINTER_ASSERT(exp)                                                                \
260             NW_ASSERTMSG(                                                                     \
261                    ((NW_ANY_TO_PTR_VALUE(exp) & 0xF0000000) == 0x80000000)    /* Cached   */  \
262                 || ((NW_ANY_TO_PTR_VALUE(exp) & 0xF0000000) == 0xC0000000),   /* Uncached */  \
263                 "NW:Pointer Error\n"#exp"(=%p) is not valid pointer.", (exp) )
264 #endif
265 #endif
266 
267 #ifndef NW_REFERENCE_ASSERT
268 #define NW_REFERENCE_ASSERT(ref) NW_POINTER_ASSERT(&ref)
269 #endif
270 
271 //--------------------------------------------------------------------------------
272 //  Range error
273 //
274 
275 #ifndef NW_U8_RANGE_ASSERT
276 #define NW_U8_RANGE_ASSERT(exp) \
277             NW_MINMAX_ASSERT(exp, 0, UCHAR_MAX)
278 #endif
279 
280 #ifndef NW_S8_RANGE_ASSERT
281 #define NW_S8_RANGE_ASSERT(exp) \
282             NW_MINMAX_ASSERT(exp, SCHAR_MIN, SCHAR_MAX)
283 #endif
284 
285 #ifndef NW_U16_RANGE_ASSERT
286 #define NW_U16_RANGE_ASSERT(exp) \
287             NW_MINMAX_ASSERT(exp, 0, USHRT_MAX)
288 #endif
289 
290 #ifndef NW_S16_RANGE_ASSERT
291 #define NW_S16_RANGE_ASSERT(exp) \
292             NW_MINMAX_ASSERT(exp, SHRT_MIN, SHRT_MAX)
293 #endif
294 
295 #ifndef NW_U32_RANGE_ASSERT
296 #define NW_U32_RANGE_ASSERT(exp) \
297             NW_MINMAX_ASSERT(exp, 0, UINT_MAX)
298 #endif
299 
300 #ifndef NW_S32_RANGE_ASSERT
301 #define NW_S32_RANGE_ASSERT(exp) \
302             NW_MINMAX_ASSERT(exp, INT_MIN, INT_MAX)
303 #endif
304 
305 //--------------------------------------------------------------------------------
306 //  Floating point value error
307 //
308 
309 #ifndef NW_FLOAT_ASSERT
310 #ifdef  NW_FROM_TOOL
311 #define NW_FLOAT_ASSERT   true ? 0:
312 #else
313 #define NW_FLOAT_ASSERT(exp) \
314             NW_ASSERTMSG((isfinite(exp) && !isnan(exp)), "NW:Floating Point Value Error(%f)\n"#exp" is infinite or nan.", exp)
315 #endif
316 #endif
317 
318 
319 #if !defined( NW_ASSERTION_ENABLE )
320 #define NW_GL_ASSERT() ((void)0)
321 #else
322 
323 inline const char*
324 nwGlErrorString( u32 err )
325 {
326     typedef struct
327     {
328         u32 value;
329         const char* name;
330     } EnumString;
331 
332     static const EnumString ENUM_STRINGS[] =
333     {
334         { 0,      "GL_NO_ERROR"      },
335         { 0x0500, "GL_INVALID_ENUM"  },
336         { 0x0501, "GL_INVALID_VALUE" },
337         { 0x0502, "GL_INVALID_OPERATION" },
338         { 0x0505, "GL_OUT_OF_MEMORY" },
339         { 0x0506, "GL_INVALID_FRAMEBUFFER_OPERATION" },
340         { 0x8000, "in nngxGemCmdlists"},
341         { 0x8001, "in nngxGemCmdlists"},
342         { 0x8002, "in nngxDeleteCmdlists"},
343         { 0x8003, "in nngxDeleteCmdlists"},
344         { 0x8004, "in nngxBindCmdlist"},
345         { 0x8005, "in nngxBindCmdlist"},
346         { 0x8006, "in nngxCmdlistStorage"},
347         { 0x8007, "in nngxCmdlistStorage"},
348         { 0x8008, "in nngxCmdlistStorage"},
349         { 0x8009, "in nngxRunCmdlist"},
350         { 0x800A, "in nngxReserveStopCmdlist"},
351         { 0x800B, "in nngxReserveStopCmdlist"},
352         { 0x800C, "in nngxSplitDrawCmdlist"},
353         { 0x800D, "in nngxSplitDrawCmdlist"},
354         { 0x800E, "in nngxSplitDrawCmdlist"},
355         { 0x800F, "in nngxClearCmdlist"},
356         { 0x8010, "in nngxSetCmdlistCallback"},
357         { 0x8012, "in nngxEnableCmdlistCallback"},
358         { 0x8014, "in nngxDisableCmdlistCallback"},
359         { 0x8015, "in nngxSetCmdlistParameteri"},
360         { 0x8016, "in nngxSetCmdlistParameteri"},
361         { 0x8017, "in nngxGetCmdlistParameteri"},
362         { 0x8018, "in nngxGetCmdlistParameteri"},
363         { 0x8019, "in nngxCheckVSync"},
364         { 0x801A, "in nngxWaitVSync"},
365         { 0x801B, "in nngxSetVSyncCallback"},
366         { 0x801C, "in nngxGenDisplaybuffers"},
367         { 0x801D, "in nngxGetDisplaybuffers"},
368         { 0x801E, "in nngxDeleteDisplayBuffers"},
369         { 0x801F, "in nngxActiveDisplay"},
370         { 0x8020, "in nngxBindDisplaybuffer"},
371         { 0x8021, "in nngxDisplaybufferStorage"},
372         { 0x8022, "in nngxDisplaybufferStorage"},
373         { 0x8023, "in nngxDisplaybufferStorage"},
374         { 0x8024, "in nngxDisplaybufferStorage"},
375         { 0x8025, "in nngxDisplaybufferStorage"},
376         { 0x8026, "in nngxDisplayEnv"},
377         { 0x8027, "in nngxTransferRenderImage"},
378         { 0x8028, "in nngxTransferRenderImage"},
379         { 0x8029, "in nngxTransferRenderImage"},
380         { 0x802A, "in nngxTransferRenderImage"},
381         { 0x802B, "in nngxTransferRenderImage"},
382         { 0x802C, "in nngxTransferRenderImage"},
383         { 0x802D, "in nngxTransferRenderImage"},
384         { 0x802E, "in nngxTransferRenderImage"},
385         { 0x802F, "in nngxTransferRenderImage"},
386         { 0x8030, "in nnwxSwapBuffers"},
387         { 0x8031, "in nngxSwapBuffers"},
388         { 0x8032, "in nngxSwapBuffers"},
389         { 0x8033, "in nngxGetDisplaybufferParameteri"},
390         { 0x8034, "in nngxStartCmdlistSave"},
391         { 0x8035, "in nngxStartCmdlistSave"},
392         { 0x8036, "in nngxStopCmdlistSave"},
393         { 0x8037, "in nngxUseSavedCmdlist"},
394         { 0x8038, "in nngxUseSavedCmdlist"},
395         { 0x8039, "in nngxUseSavedCmdlist"},
396         { 0x803A, "in nngxUseSavedCmdlist"},
397         { 0x803B, "in nngxExportCmdlist"},
398         { 0x803C, "in nngxExportCmdlist"},
399         { 0x803D, "in nngxExportCmdlist"},
400         { 0x803E, "in nngxExportCmdlist"},
401         { 0x803F, "in nngxExportCmdlist"},
402         { 0x8040, "in nngxExportCmdlist"},
403         { 0x8041, "in nngxImportCmdlist"},
404         { 0x8042, "in nngxImportCmdlist"},
405         { 0x8043, "in nngxImportCmdlist"},
406         { 0x8044, "in nngxImportCmdlist"},
407         { 0x8045, "in nngxImportCmdlist"},
408         { 0x8046, "in nngxGetExportedCmdlistInfo"},
409         { 0x8047, "in nngxCopyCmdlist"},
410         { 0x8048, "in nngxCopyCmdlist"},
411         { 0x8049, "in nngxCopyCmdlist"},
412         { 0x804A, "in nngxCopyCmdlist"},
413         { 0x804B, "in nngxCopyCmdlist"},
414         { 0x804C, "in nngxCopyCmdlist"},
415         { 0x804D, "in nngxSetCommandGenerationMode"},
416         { 0x804E, "in nngxAdd3DCommand"},
417         { 0x804F, "in nngxAdd3DCommand"},
418         { 0x8050, "in nngxAdd3DCommand"},
419         { 0x8051, "in nngxAdd3DCommand"},
420         { 0x8052, "in nngxAdd3DCommand"},
421         { 0x8053, "in nngxSwapBuffers"},
422         { 0x8054, "in nngxAddCmdlist"},
423         { 0x8055, "in nngxAddCmdlist"},
424         { 0x8056, "in nngxAddCmdlist"},
425         { 0x8057, "in nngxAddCmdlist"},
426         { 0x8058, "in nngxAddCmdlist"},
427         { 0x8059, "in nngxTransferRenderImage"},
428         { 0x805A, "in nngxTransferRenderImage"},
429         { 0x805B, "in nngxTransferLinearImage"},
430         { 0x805C, "in nngxTransferLinearImage"},
431         { 0x805D, "in nngxTransferLinearImage"},
432         { 0x805E, "in nngxTransferLinearImage"},
433         { 0x805F, "in nngxTransferLinearImage"},
434         { 0x8060, "in nngxTransferLinearImage"},
435         { 0x8062, "in nngxAddVramDmaCommand"},
436         { 0x8063, "srcAddr alignment error in nngxAddVramDmaCommand"},
437         { 0x8064, "in nngxAddVramDmaCommand"},
438         { 0x8065, "in nngxClearFillCmdlist"},
439         { 0x8066, "in nngxValidateState"},
440         { 0x8067, "in nngxTransferLinearImage"},
441         { 0x8068, "in nngxFilterBlockImage"},
442         { 0x8069, "in nngxFilterBlockImage"},
443         { 0x806A, "in nngxFilterBlockImage"},
444         { 0x806B, "in nngxFilterBlockImage"},
445         { 0x806C, "in nngxValidateState"},
446         { 0x9000, "in nngxSwapBuffers"},
447         { 0x9001, "in nngxSwapBuffers"},
448         { 0x9002, "in nngxSwapBuffers"},
449         { 0x9003, "in nngxSetDisplayMode"},
450     };
451 
452     const int NUM_ENUM_STRING = sizeof(ENUM_STRINGS) / sizeof(ENUM_STRINGS[0]);
453 
454     for (int idx = 0; idx < NUM_ENUM_STRING; ++idx)
455     {
456         if ( ENUM_STRINGS[ idx ].value == err )
457         {
458             return ENUM_STRINGS[ idx ].name;
459         }
460     }
461 
462     return "Unknown";
463 }
464 
465 #define NW_GL_ASSERT()                                              \
466     do {                                                            \
467         GLuint err = glGetError();                                  \
468         NW_ASSERTMSG( err == GL_NO_ERROR, "GL_ERROR : %s (0x%x)", nwGlErrorString( err ), err ); \
469     } while (0)
470 #endif
471 
472 //--------------------------------------------------------------------------------
473 //  Warning
474 //
475 
476 #ifndef NW_WARNING
477 //#ifdef  NW_FROM_TOOL
478 #if !defined(NW_WARNING_ENABLE)
479   #define NW_WARNING(exp, ...) ((void)0)
480 #else
481   #define NW_WARNING(exp, ...) (void) ((exp) || (nwosWarning(__VA_ARGS__), 0))
482 #endif
483 //#else
484 //#define NW_WARNING    NW_DB_EXP_WARNING
485 //#endif
486 #endif
487 
488 //--------------------------------------------------------------------------------
489 //  Fail safe
490 //
491 
492 #if !defined( NW_ASSERTION_ENABLE )
493 #define NW_FAILSAFE_IF(exp) if (exp)
494 #else
495 #define NW_FAILSAFE_IF(exp) if (exp) { NW_FATAL_ERROR(#exp); } if (false)
496 #endif
497 
498 //--------------------------------------------------------------------------------
499 //  Log
500 //
501 //#ifndef NW_LOG
502 //#ifdef  NW_FROM_TOOL
503 #define NW_LOG    nwosPrintf
504 //#else
505 //#define NW_LOG    NW_DB_LOG
506 //#endif
507 //#endif
508 
509 
510 //--------------------------------------------------------------------------------
511 //  デバッグ時のみ有効で Development ではチェックしない ASSERT
512 //
513 
514 #if defined( NW_DEBUG )
515 #define NW_DEBUG_ASSERTMSG      NW_ASSERTMSG
516 #define NW_DEBUG_ASSERT         NW_ASSERT
517 #define NW_DEBUG_NULL_ASSERT    NW_NULL_ASSERT
518 #else
519 #define NW_DEBUG_ASSERTMSG(exp, ...) ((void)0)
520 #define NW_DEBUG_ASSERT(exp)         ((void)0)
521 #define NW_DEBUG_NULL_ASSERT(exp)    ((void)0)
522 #endif
523 
524 /* NW_ASSERT_H_ */
525 #endif
526