D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19177 - No version (Solaris) in druntime/src/core/stdc/time.d
Summary: No version (Solaris) in druntime/src/core/stdc/time.d
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: x86_64 Solaris
: P1 critical
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-17 15:39 UTC by crayolist
Modified: 2018-08-29 14:13 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description crayolist 2018-08-17 15:39:03 UTC
When building ldc I get the following error;

/root/work/ldc/runtime/druntime/src/core/stdc/time.d(142): Error: static assert:  "unsupported system"

This is because there is no version (Solaris) declared.

Need to add:

else version ( Solaris )
{
    enum clock_t CLOCKS_PER_SEC = 1_000_000;
    clock_t clock();
}









Here is the full section;

///
version( Windows )
{
    enum clock_t CLOCKS_PER_SEC = 1000;
    clock_t clock();
}
else version( OSX )
{
    enum clock_t CLOCKS_PER_SEC = 100;
    version (X86)
        extern (C) pragma(mangle, "clock$UNIX2003") clock_t clock();
    else
        clock_t clock();
}
else version( Darwin ) // other Darwins (iOS, TVOS, WatchOS)
{
    enum clock_t CLOCKS_PER_SEC = 1_000_000;
    clock_t clock();
}
else version( FreeBSD )
{
    enum clock_t CLOCKS_PER_SEC = 128;
    clock_t clock();
}
else version( NetBSD )
{
    enum clock_t CLOCKS_PER_SEC = 100;
    clock_t clock();
}
else version( OpenBSD )
{
    enum clock_t CLOCKS_PER_SEC = 100;
    clock_t clock();
}
else version( DragonFlyBSD )
{
    enum clock_t CLOCKS_PER_SEC = 128;
    clock_t clock();
}
else version (CRuntime_Glibc)
{
    enum clock_t CLOCKS_PER_SEC = 1_000_000;
    clock_t clock();
}
else version (CRuntime_Musl)
{
    enum clock_t CLOCKS_PER_SEC = 1_000_000;
    clock_t clock();
}
else version (CRuntime_Bionic)
{
    enum clock_t CLOCKS_PER_SEC = 1_000_000;
    clock_t clock();
}
else version (CRuntime_UClibc)
{
    enum clock_t CLOCKS_PER_SEC = 1_000_000;
    clock_t clock();
}
else
{
    static assert(0, "unsupported system");
}
Comment 1 RazvanN 2018-08-29 08:31:47 UTC
PR: https://github.com/dlang/druntime/pull/2288
Comment 2 github-bugzilla 2018-08-29 14:13:02 UTC
Commits pushed to master at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/4b5be6e76061a76c7b173f11d2d348a7541eb0f5
Fix issue 19177: add clock() and CLOCKS_PER_SEC for Solaris

https://github.com/dlang/druntime/commit/d2e0f2c52668634d7e5e67ac7aa2f3e238877e05
Merge pull request #2288 from ZombineDev/fix-19177

Fix issue 19177: add clock() and CLOCKS_PER_SEC for Solaris
merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>