Changeset 9538 for trunk/psLib/src/sys/psAssert.h
- Timestamp:
- Oct 13, 2006, 11:13:48 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psAssert.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psAssert.h
r8921 r9538 6 6 #include <math.h> 7 7 8 #include "psMemory.h" 8 9 #include "psError.h" 9 10 #include "psLogMsg.h" 11 12 // Ensure this is a psLib pointer, by checking for the memblock bounds. 13 #define PS_ASSERT_PTR(NAME, RVAL) \ 14 { \ 15 psMemBlock *mb = (psMemBlock*)(NAME) - 1; \ 16 if (mb->startblock != P_PS_MEMMAGIC || mb->endblock != P_PS_MEMMAGIC || \ 17 *(psPtr *)((int8_t *) (mb + 1) + mb->userMemorySize) != P_PS_MEMMAGIC) { \ 18 psError(PS_ERR_MEMORY_CORRUPTION, false, \ 19 "Error: Pointer %s is corrupted or not on the PS memory system.", \ 20 #NAME); \ 21 return (RVAL); \ 22 } \ 23 } 10 24 11 25 #define PS_ASSERT_INT_UNEQUAL(NAME1, NAME2, RVAL) \
Note:
See TracChangeset
for help on using the changeset viewer.
