Index: src/Makefile ================================================================== --- src/Makefile +++ src/Makefile @@ -172,8 +172,8 @@ ${EXCEPTIONS_EXCEPTIONS_LIB_A} \ ${FORWARDING_FORWARDING_LIB_A} include ../buildsys.mk -CPPFLAGS += -I. -I.. -Iexceptions -Iruntime +CPPFLAGS += -I. -I.. -Iexceptions -Iruntime -DOF_COMPILING_OBJFW LD = ${OBJC} LDFLAGS += ${REEXPORT_LIBOBJC} Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -28,10 +28,11 @@ #include #include #import "macros.h" #import "autorelease.h" +#import "block.h" OF_ASSUME_NONNULL_BEGIN /*! @file */ Index: src/block.h ================================================================== --- src/block.h +++ src/block.h @@ -39,10 +39,22 @@ #ifdef __cplusplus extern "C" { #endif extern void* _Block_copy(const void*); extern void _Block_release(const void*); + +# if defined(OF_WINDOWS) && defined(OF_COMPILING_OBJFW) +/* + * Clang has implicit declarations for these, but they are dllimport. When + * compiling ObjFW itself, these need to be dllexport. + */ +extern __declspec(dllexport) struct objc_abi_class _NSConcreteStackBlock; +extern __declspec(dllexport) struct objc_abi_class _NSConcreteGlobalBlock; +extern __declspec(dllexport) void _Block_object_assign(void*, const void*, + const int); +extern __declspec(dllexport) void _Block_object_dispose(const void*, const int); +# endif #ifdef __cplusplus } #endif #ifndef Block_copy Index: src/exceptions/Makefile ================================================================== --- src/exceptions/Makefile +++ src/exceptions/Makefile @@ -67,6 +67,6 @@ INCLUDES = ${SRCS:.m=.h} include ../../buildsys.mk -CPPFLAGS += -I. -I.. -I../.. -I../runtime +CPPFLAGS += -I. -I.. -I../.. -I../runtime -DOF_COMPILING_OBJFW Index: src/runtime/Makefile ================================================================== --- src/runtime/Makefile +++ src/runtime/Makefile @@ -27,6 +27,6 @@ OBJS_EXTRA = ${LOOKUP_ASM_LOOKUP_ASM_A} LIB_OBJS_EXTRA = ${LOOKUP_ASM_LOOKUP_ASM_LIB_A} include ../../buildsys.mk -CPPFLAGS += -I. -I.. -I../.. +CPPFLAGS += -I. -I.. -I../.. -DOF_COMPILING_OBJFW