Skip to content

Commit ae5c746

Browse files
committed
Add string.h for memcpy in Data.swift.
In Data.swift the C function memcpy is used as part of _copyBytesHelper. The function is defined in string.h, but that header is not referenced directly by any of the headers in dispatch/ or by DispatchOverlayShims.h in the compiler, which are the only two headers imported by the swift file. For some reason, this is working on Darwin and Ubuntu, probably because some included header includes string.h or defines memcpy, avoiding the problem. For those platforms that this already works, adding an extra include should not affect them.
1 parent 64a12c6 commit ae5c746

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

dispatch/dispatch.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <stdint.h>
3838
#include <stdbool.h>
3939
#include <stdarg.h>
40+
#include <string.h>
4041
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
4142
#include <unistd.h>
4243
#endif

0 commit comments

Comments
 (0)