Skip to content

Commit 3bb8469

Browse files
committed
[misc. platform-specific druntime fixes]
1 parent b431722 commit 3bb8469

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

runtime/druntime/src/core/thread/fiber/package.d

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ import core.thread.threadgroup;
1818
import core.thread.types;
1919

2020
import core.memory : pageSize;
21-
version (LDC) import ldc.llvmasm;
21+
22+
version (LDC)
23+
{
24+
import ldc.attributes;
25+
import ldc.llvmasm;
26+
}
2227

2328
///////////////////////////////////////////////////////////////////////////////
2429
// Fiber Platform Detection

runtime/druntime/src/rt/cover.d

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ else version (Posix)
2727
{
2828
import core.stdc.stdio : fopen;
2929
import core.sys.posix.fcntl : O_CREAT, O_RDWR, open, S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWOTH, S_IWUSR;
30-
import core.sys.posix.unistd : F_LOCK, ftruncate, lockf;
30+
import core.sys.posix.unistd : ftruncate;
3131
}
3232
else
3333
static assert(0, "Unsupported platform");
@@ -487,7 +487,10 @@ void lockFile(int fd)
487487
flock(fd, LOCK_EX); // exclusive lock
488488
}
489489
else version (Posix)
490+
{
491+
import core.sys.posix.unistd : F_LOCK, lockf;
490492
lockf(fd, F_LOCK, 0); // exclusive lock
493+
}
491494
else version (Windows)
492495
{
493496
OVERLAPPED off;

runtime/druntime/src/rt/sections_elf_shared.d

+6-2
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,17 @@ import core.memory;
5050
import core.stdc.config : c_ulong;
5151
import core.stdc.stdlib : calloc, free, malloc;
5252
version (Shared) import core.sync.mutex;
53-
import core.sys.posix.pthread : pthread_mutex_destroy, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_unlock;
54-
import core.sys.posix.sys.types : pthread_mutex_t;
5553
import rt.deh;
5654
import rt.dmain2;
5755
import rt.minfo;
5856
import rt.util.utility : safeAssert;
5957

58+
version (Posix)
59+
{
60+
import core.sys.posix.pthread : pthread_mutex_destroy, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_unlock;
61+
import core.sys.posix.sys.types : pthread_mutex_t;
62+
}
63+
6064
version (linux)
6165
{
6266
import core.sys.linux.dlfcn : Dl_info, dladdr, dlclose, dlinfo, dlopen, RTLD_DI_LINKMAP, RTLD_LAZY, RTLD_NOLOAD;

0 commit comments

Comments
 (0)