@@ -20,10 +20,16 @@ #include #include #import "runtime.h" #import "runtime-private.h" + +#ifndef OF_SELUID16 +# define SEL_MAX 0xFFFFFF +#else +# define SEL_MAX 0xFFFF +#endif static struct objc_sparsearray *selectors = NULL; void objc_register_selector(struct objc_abi_selector *sel) @@ -33,23 +39,23 @@ const char *name; if (selectors == NULL) selectors = objc_sparsearray_new(); - hash = objc_hash_string(sel->name) & 0xFFFFFF; + hash = objc_hash_string(sel->name) & SEL_MAX; - while (hash <= 0xFFFFFF && + while (hash <= SEL_MAX && (name = objc_sparsearray_get(selectors, hash)) != NULL) { if (!strcmp(name, sel->name)) { rsel->uid = hash; return; } hash++; } - if (hash > 0xFFFFFF) { + if (hash > SEL_MAX) { last = hash; hash = 0; while (hash < last && (name = objc_sparsearray_get(selectors, hash)) != NULL) {