Fix the build issues on mac for some samples (#358)

Fix the build issues on mac for basic/multi-module/multi-thread/
simple/spawn-thread/wasm-c-api under samples.
And all these samples could be run as expected.

Signed-off-by: Xiaokang Qin <xiaokang.qxk@antgroup.com>
This commit is contained in:
qinxk-inter
2020-08-21 15:14:04 +08:00
committed by GitHub
parent 0103f6429c
commit 049760b849
8 changed files with 78 additions and 18 deletions

View File

@ -2137,7 +2137,11 @@ static void convert_timestamp(
struct timespec *out
) {
// Store sub-second remainder.
#ifndef __APPLE__
out->tv_nsec = (__syscall_slong_t)(in % 1000000000);
#else
out->tv_nsec = (long)(in % 1000000000);
#endif
in /= 1000000000;
// Clamp to the maximum in case it would overflow our system's time_t.