Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -502,10 +502,11 @@ AC_MSG_RESULT($objc_runtime) case "$objc_runtime" in "ObjFW runtime") AC_DEFINE(OF_OBJFW_RUNTIME, 1, [Whether we use the ObjFW runtime]) + AC_SUBST(USE_SRCS_TAGGED_POINTER, '${SRCS_TAGGED_POINTER}') AC_MSG_CHECKING([whether -fobjc-runtime=objfw is supported]) old_OBJCFLAGS="$OBJCFLAGS" OBJCFLAGS="$OBJCFLAGS -Xclang -fobjc-runtime=objfw" Index: extra.mk.in ================================================================== --- extra.mk.in +++ extra.mk.in @@ -82,9 +82,10 @@ USE_SRCS_APPLETALK = @USE_SRCS_APPLETALK@ USE_SRCS_FILES = @USE_SRCS_FILES@ USE_SRCS_IPX = @USE_SRCS_IPX@ USE_SRCS_PLUGINS = @USE_SRCS_PLUGINS@ USE_SRCS_SOCKETS = @USE_SRCS_SOCKETS@ +USE_SRCS_TAGGED_POINTER = @USE_SRCS_TAGGED_POINTER@ USE_SRCS_THREADS = @USE_SRCS_THREADS@ USE_SRCS_UNIX_SOCKETS = @USE_SRCS_UNIX_SOCKETS@ USE_SRCS_WINDOWS = @USE_SRCS_WINDOWS@ WRAPPER = @WRAPPER@ Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -204,18 +204,16 @@ OFSandbox.m \ OFStrFTime.m \ OFStrPTime.m \ OFSubarray.m \ OFSubdata.m \ - OFTaggedPointerColor.m \ - OFTaggedPointerDate.m \ - OFTaggedPointerNumber.m \ OFUTF8String.m \ ${LIBBASES_M} \ ${RUNTIME_AUTORELEASE_M} \ ${RUNTIME_INSTANCE_M} \ - ${UNICODE_M} + ${UNICODE_M} \ + ${USE_SRCS_TAGGED_POINTER} SRCS_FILES += OFFileIRIHandler.m SRCS_SOCKETS += OFAsyncIPSocketConnector.m \ OFDNSResolverSettings.m \ ${OF_EPOLL_KERNEL_EVENT_OBSERVER_M} \ OFHTTPIRIHandler.m \ @@ -223,10 +221,13 @@ OFKernelEventObserver.m \ ${OF_KQUEUE_KERNEL_EVENT_OBSERVER_M} \ ${OF_POLL_KERNEL_EVENT_OBSERVER_M} \ ${OF_SELECT_KERNEL_EVENT_OBSERVER_M} \ OFTCPSocketSOCKS5Connector.m +SRCS_TAGGED_POINTER = OFTaggedPointerColor.m \ + OFTaggedPointerDate.m \ + OFTaggedPointerNumber.m SRCS_WINDOWS += platform/Windows/OFWin32ConsoleStdIOStream.m \ versioninfo.rc OBJS_EXTRA = exceptions/exceptions.a \ encodings/encodings.a \ Index: src/OFTaggedPointerColor.h ================================================================== --- src/OFTaggedPointerColor.h +++ src/OFTaggedPointerColor.h @@ -15,14 +15,12 @@ #import "OFColor.h" OF_ASSUME_NONNULL_BEGIN -#ifdef OF_OBJFW_RUNTIME @interface OFTaggedPointerColor: OFColor + (OFTaggedPointerColor *)colorWithRed: (uint8_t)red green: (uint8_t)green blue: (uint8_t)blue; @end -#endif OF_ASSUME_NONNULL_END Index: src/OFTaggedPointerColor.m ================================================================== --- src/OFTaggedPointerColor.m +++ src/OFTaggedPointerColor.m @@ -15,11 +15,10 @@ #include "config.h" #import "OFTaggedPointerColor.h" -#ifdef OF_OBJFW_RUNTIME static int colorTag; @implementation OFTaggedPointerColor + (void)initialize { @@ -50,6 +49,5 @@ *alpha = 1; } OF_SINGLETON_METHODS @end -#endif Index: src/OFTaggedPointerDate.h ================================================================== --- src/OFTaggedPointerDate.h +++ src/OFTaggedPointerDate.h @@ -15,12 +15,12 @@ #import "OFDate.h" OF_ASSUME_NONNULL_BEGIN -#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX +#if UINTPTR_MAX == UINT64_MAX @interface OFTaggedPointerDate: OFDate + (OFTaggedPointerDate *)dateWithUInt64TimeIntervalSince1970: (uint64_t)value; @end #endif OF_ASSUME_NONNULL_END Index: src/OFTaggedPointerDate.m ================================================================== --- src/OFTaggedPointerDate.m +++ src/OFTaggedPointerDate.m @@ -13,11 +13,11 @@ * file. */ #import "OFTaggedPointerDate.h" -#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX +#if UINTPTR_MAX == UINT64_MAX static int dateTag; @implementation OFTaggedPointerDate + (void)initialize { Index: src/OFTaggedPointerNumber.h ================================================================== --- src/OFTaggedPointerNumber.h +++ src/OFTaggedPointerNumber.h @@ -15,13 +15,11 @@ #import "OFNumber.h" OF_ASSUME_NONNULL_BEGIN -#ifdef OF_OBJFW_RUNTIME -# define OFTaggedPointerNumberTagBits 4 +#define OFTaggedPointerNumberTagBits 4 @interface OFTaggedPointerNumber: OFNumber @end -#endif OF_ASSUME_NONNULL_END Index: src/OFTaggedPointerNumber.m ================================================================== --- src/OFTaggedPointerNumber.m +++ src/OFTaggedPointerNumber.m @@ -17,11 +17,10 @@ #import "OFTaggedPointerNumber.h" #import "OFInvalidFormatException.h" -#ifdef OF_OBJFW_RUNTIME enum Tag { tagChar, tagShort, tagInt, tagLong, @@ -140,11 +139,11 @@ default: @throw [OFInvalidFormatException exception]; } } -# define RETURN_VALUE \ +#define RETURN_VALUE \ uintptr_t value = object_getTaggedPointerValue(self); \ \ switch (value & tagMask) { \ case tagChar: \ return (signed char)(unsigned char) \ @@ -191,10 +190,9 @@ - (double)doubleValue { RETURN_VALUE } -# undef RETURN_VALUE +#undef RETURN_VALUE OF_SINGLETON_METHODS @end -#endif