Index: src/block.h ================================================================== --- src/block.h +++ src/block.h @@ -40,14 +40,15 @@ extern "C" { #endif extern void *_Block_copy(const void *); extern void _Block_release(const void *); -# if defined(OF_WINDOWS) && defined(OF_COMPILING_OBJFW) +# ifdef OF_WINDOWS /* * Clang has implicit declarations for these, but they are dllimport. When - * compiling ObjFW itself, these need to be dllexport. + * compiling ObjFW itself or using it as a static library, these need to be + * dllexport. Interestingly, this still works when using it as a shared library. */ 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); Index: tests/OFBlockTests.m ================================================================== --- tests/OFBlockTests.m +++ tests/OFBlockTests.m @@ -28,13 +28,13 @@ #import "TestsAppDelegate.h" static OFString *module = @"OFBlock"; -extern void *_NSConcreteStackBlock; -extern void *_NSConcreteGlobalBlock; -extern void *_NSConcreteMallocBlock; +extern struct objc_abi_class _NSConcreteStackBlock; +extern struct objc_abi_class _NSConcreteGlobalBlock; +extern struct objc_abi_class _NSConcreteMallocBlock; static void (^g)(void) = ^ {}; static int (^returnStackBlock(void))(void)