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"); }
PR: https://github.com/dlang/druntime/pull/2288
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>