Bug 19177 – No version (Solaris) in druntime/src/core/stdc/time.d

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Solaris
Creation time
2018-08-17T15:39:03Z
Last change time
2018-08-29T14:13:03Z
Assigned to
No Owner
Creator
crayolist

Comments

Comment #0 by crayolist — 2018-08-17T15:39:03Z
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 by razvan.nitu1305 — 2018-08-29T08:31:47Z
Comment #2 by github-bugzilla — 2018-08-29T14:13:02Z
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 <[email protected]>