commit
912fbb9893
8 changed files with 11 additions and 10 deletions
|
|
@ -62,9 +62,9 @@ var
|
|||
|
||||
proc genOid*(): TOid =
|
||||
## generates a new OID.
|
||||
proc rand(): cint {.importc: "rand", nodecl.}
|
||||
proc rand(): cint {.importc: "rand", header: "<stdlib.h>", nodecl.}
|
||||
proc gettime(dummy: ptr cint): cint {.importc: "time", header: "<time.h>".}
|
||||
proc srand(seed: cint) {.importc: "srand", nodecl.}
|
||||
proc srand(seed: cint) {.importc: "srand", header: "<stdlib.h>", nodecl.}
|
||||
|
||||
var t = gettime(nil)
|
||||
|
||||
|
|
|
|||
|
|
@ -903,7 +903,7 @@ elif not defined(useNimRtl):
|
|||
createStream(p.errStream, p.errHandle, fmRead)
|
||||
return p.errStream
|
||||
|
||||
proc csystem(cmd: cstring): cint {.nodecl, importc: "system".}
|
||||
proc csystem(cmd: cstring): cint {.nodecl, importc: "system", header: "<stdlib.h>".}
|
||||
|
||||
proc execCmd(command: string): int =
|
||||
when defined(linux):
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
# set handling
|
||||
|
||||
type
|
||||
TNimSet = array [0..4*2048-1, int8]
|
||||
TNimSet = array [0..4*2048-1, uint8]
|
||||
|
||||
proc countBits32(n: int32): int {.compilerproc.} =
|
||||
var v = n
|
||||
|
|
@ -25,4 +25,4 @@ proc countBits64(n: int64): int {.compilerproc.} =
|
|||
proc cardSet(s: TNimSet, len: int): int {.compilerproc.} =
|
||||
result = 0
|
||||
for i in countup(0, len-1):
|
||||
inc(result, countBits32(int32(ze(s[i]))))
|
||||
inc(result, countBits32(int32(s[i])))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue