define function in NSObject.m so that it won't be omitted by clever linkers

This commit is contained in:
rfm 2025-01-19 10:23:33 +00:00
parent 2cf2b2d7b9
commit 9b4965e100
2 changed files with 10 additions and 9 deletions

View file

@ -83,6 +83,16 @@
#endif
#endif
/* objc_enumerationMutation() is called whenever a collection mutates in the
* middle of fast enumeration. We need to have this defined and linked into
* any code that uses fast enumeration, so we define it in NSObject.h
*/
void objc_enumerationMutation(id obj)
{
[NSException raise: NSGenericException
format: @"Collection %@ was mutated while being enumerated", obj];
}
/* platforms which do not support weak */
#if defined (__WIN32)
#define WEAK_ATTRIBUTE