Skip to content

Commit 6a18e54

Browse files
committed
External symbols should be imported from the DLL
1 parent 5c7378c commit 6a18e54

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

NSBlocks.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
#include <assert.h>
88

99
#ifdef EMBEDDED_BLOCKS_RUNTIME
10-
#define BLOCK_STORAGE OBJC_PUBLIC
10+
# define BLOCK_STORAGE OBJC_PUBLIC
1111
#else
12-
#define BLOCK_STORAGE extern
13-
#endif
12+
# if defined(_WIN32)
13+
# define BLOCK_STORAGE __attribute__((dllimport))
14+
# else
15+
# define BLOCK_STORAGE extern
16+
# endif // defined(_WIN32)
17+
#endif // EMBEDDED_BLOCKS_RUNTIME
1418

1519
BLOCK_STORAGE struct objc_class _NSConcreteGlobalBlock;
1620
BLOCK_STORAGE struct objc_class _NSConcreteStackBlock;
@@ -76,4 +80,4 @@ PRIVATE void init_early_blocks(void)
7680
_NSConcreteMallocBlock.info = objc_class_flag_is_block;
7781
_NSConcreteAutoBlock.info = objc_class_flag_is_block;
7882
_NSConcreteFinalizingBlock.info = objc_class_flag_is_block;
79-
}
83+
}

0 commit comments

Comments
 (0)