Make the version of libobjc generated by the makefile the one Etoile expects

main
theraven 15 years ago
parent bb283464cd
commit a7d4cfd640

@ -2,7 +2,7 @@
.SUFFIXES: .cc .c .m .o
MAJOR_VERSION = 1
MAJOR_VERSION = 4
MINOR_VERSION = 6
SUBMINOR_VERSION = 0
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBMINOR_VERSION)
@ -14,6 +14,8 @@ CPPFLAGS += -D__OBJC_RUNTIME_INTERNAL__=1 -D_XOPEN_SOURCE=500
# Suppress warnings about incorrect selectors
CPPFLAGS += -DNO_SELECTOR_MISMATCH_WARNINGS
# Some helpful flags for debugging.
#CPPFLAGS += -g -O0 -fno-inline
PREFIX?= /usr/local
LIB_DIR= ${PREFIX}/lib

@ -261,11 +261,16 @@ void class_table_insert(Class class);
*/
extern Class SmallObjectClasses[4];
static BOOL isSmallObject(id obj)
{
uintptr_t addr = ((uintptr_t)obj);
return (addr & OBJC_SMALL_OBJECT_MASK) != 0;
}
__attribute__((always_inline))
static inline Class classForObject(id obj)
{
uintptr_t addr = ((uintptr_t)obj);
if (UNLIKELY((addr & 1) == 1))
if (UNLIKELY(isSmallObject(obj)))
{
if (sizeof(Class) == 4)
{
@ -273,15 +278,11 @@ static inline Class classForObject(id obj)
}
else
{
uintptr_t addr = ((uintptr_t)obj);
return SmallObjectClasses[((addr >> 1) & 3)];
}
}
return obj->isa;
}
static BOOL isSmallObject(id obj)
{
uintptr_t addr = ((uintptr_t)obj);
return (addr & 1) == 1;
}
#endif //__OBJC_CLASS_H_INCLUDED

Loading…
Cancel
Save