Skip to content

Commit 40496bb

Browse files
Merge pull request #4869 from kateinoigakukun/pr-c22e31c72f24e4dfb622a01da59752a0bf3f863a
[wasm] Port BlocksRuntime for no dlfcn.h platforms
2 parents 2b752a5 + 18d6a75 commit 40496bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/BlocksRuntime/runtime.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#if TARGET_OS_WIN32
1616
#include <Windows.h>
1717
#include <Psapi.h>
18-
#else
18+
#elif __has_include(<dlfcn.h>)
1919
#include <dlfcn.h>
2020
#endif
2121
#if __has_include(<os/assumes.h>)
@@ -268,7 +268,11 @@ void _Block_use_RR( void (*retain)(const void *),
268268
break;
269269
}
270270
#else
271+
# if __has_include(<dlfcn.h>)
271272
_Block_destructInstance = dlsym(RTLD_DEFAULT, "objc_destructInstance");
273+
# else
274+
_Block_destructInstance = _Block_destructInstance_default;
275+
# endif
272276
#endif
273277
}
274278

0 commit comments

Comments
 (0)