231
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
233
* To be used inside a method for making sure that a range does not specify
234
* anything outside the size of an array/string. Raises exception if range
235
* extends beyond [0,size).
237
#define GS_RANGE_CHECK(RANGE, SIZE) \
238
if (RANGE.location > SIZE || RANGE.length > (SIZE - RANGE.location)) \
239
[NSException raise: NSRangeException \
240
format: @"in %s, range { %u, %u } extends beyond size (%u)", \
241
GSNameFromSelector(_cmd), RANGE.location, RANGE.length, SIZE]
243
/** Checks whether INDEX is strictly less than OVER (within C array space). */
244
#define CHECK_INDEX_RANGE_ERROR(INDEX, OVER) \
246
[NSException raise: NSRangeException \
247
format: @"in %s, index %d is out of range", \
248
GSNameFromSelector(_cmd), INDEX]
251
231
#if defined(__cplusplus)