Changeset 14676 for trunk/psLib/src/sys/psAssert.h
- Timestamp:
- Aug 27, 2007, 1:14:35 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psAssert.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psAssert.h
r12596 r14676 20 20 } 21 21 22 // Ensure this is a psLib pointer , by checking for the memblock bounds.23 #define PS_ASSERT_PTR( NAME, RVAL) \22 // Ensure this is a psLib pointer 23 #define PS_ASSERT_PTR(PTR, RVAL) \ 24 24 { \ 25 if (NAME == NULL) return(RVAL); \ 26 psMemBlock *mb = (psMemBlock*)(NAME) - 1; \ 27 if (mb->startblock != P_PS_MEMMAGIC || mb->endblock != P_PS_MEMMAGIC || \ 28 *(psU32 *)((char *)(mb + 1) + mb->userMemorySize) != P_PS_MEMMAGIC) { \ 25 if (PTR == NULL) return RVAL; \ 26 if (!psMemIsAlloced(PTR)) { \ 29 27 psError(PS_ERR_MEMORY_CORRUPTION, false, \ 30 "Error: Pointer %sis corrupted or not on the PS memory system.", \31 #NAME); \32 return (RVAL); \28 "Error: Pointer %p is corrupted or not on the PS memory system.", \ 29 PTR); \ 30 return RVAL; \ 33 31 } \ 34 32 }
Note:
See TracChangeset
for help on using the changeset viewer.
