Nim-1.2.12

This commit is contained in:
Ștefan Talpalaru 2021-02-23 20:39:10 +01:00 committed by zah
parent 0b8919f500
commit 5b32f7ca17
3 changed files with 10 additions and 3 deletions

View File

@ -283,7 +283,9 @@ ifneq ($(USE_LIBBACKTRACE), 0)
build/generate_makefile: | libbacktrace
endif
build/generate_makefile: tools/generate_makefile.nim | deps-common
$(ENV_SCRIPT) nim c -o:$@ $(NIM_PARAMS) tools/generate_makefile.nim
echo -e $(BUILD_MSG) "$@" && \
$(ENV_SCRIPT) nim c -o:$@ $(NIM_PARAMS) tools/generate_makefile.nim && \
echo -e $(BUILD_END_MSG) "$@"
# GCC's LTO parallelisation is able to detect a GNU Make jobserver and get its
# maximum number of processes from there, but only if we use the "+" prefix.

View File

@ -81,7 +81,12 @@ func toSlot*(c: BeaconClock, t: Time): tuple[afterGenesis: bool, slot: Slot] =
c.toBeaconTime(t).toSlot()
func toBeaconTime*(s: Slot, offset = Duration()): BeaconTime =
BeaconTime(seconds(int64(uint64(s) * SECONDS_PER_SLOT)) + offset)
# BeaconTime/Duration stores nanoseconds, internally
const maxSlot = (not 0'u64 div 2 div SECONDS_PER_SLOT div 1_000_000_000).Slot
var slot = s
if slot > maxSlot:
slot = maxSlot
BeaconTime(seconds(int64(uint64(slot) * SECONDS_PER_SLOT)) + offset)
proc now*(c: BeaconClock): BeaconTime =
## Current time, in slots - this may end up being less than GENESIS_SLOT(!)

@ -1 +1 @@
Subproject commit e7694f16ceccd7c98ecb6870263025018b7d37b3
Subproject commit 2b097ec86aead0119c5e6bfff8502c3948a1ceaf