mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 10:22:15 +00:00
Merge remote-tracking branch 'origin/devel' into bitsize-pragma
This commit is contained in:
14
.travis.yml
14
.travis.yml
@@ -1,10 +1,20 @@
|
||||
sudo: false
|
||||
language: c
|
||||
os: linux
|
||||
os:
|
||||
- linux
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libcurl4-openssl-dev
|
||||
- libsdl1.2-dev
|
||||
script:
|
||||
- git clone --depth 1 https://github.com/nim-lang/csources.git
|
||||
- cd csources && sh build.sh
|
||||
- cd csources
|
||||
- sh build.sh
|
||||
- cd ..
|
||||
- ./bin/nim c koch
|
||||
- ./koch boot
|
||||
- ./koch boot -d:release
|
||||
after_script:
|
||||
- export PATH=$(pwd)/bin:$PATH
|
||||
- ./koch test
|
||||
|
||||
@@ -140,4 +140,7 @@ proc runNimScript*(scriptName: string) =
|
||||
# ensure we load 'system.nim' again for the real non-config stuff!
|
||||
resetAllModulesHard()
|
||||
vm.globalCtx = nil
|
||||
initDefines()
|
||||
# do not remove the defined symbols
|
||||
#initDefines()
|
||||
undefSymbol("nimscript")
|
||||
undefSymbol("nimconfig")
|
||||
|
||||
@@ -103,15 +103,16 @@ proc readData*(s: Stream, buffer: pointer, bufLen: int): int =
|
||||
|
||||
proc readAll*(s: Stream): string =
|
||||
## Reads all available data.
|
||||
result = newString(1000)
|
||||
const bufferSize = 1000
|
||||
result = newString(bufferSize)
|
||||
var r = 0
|
||||
while true:
|
||||
let readBytes = readData(s, addr(result[r]), 1000)
|
||||
if readBytes < 1000:
|
||||
let readBytes = readData(s, addr(result[r]), bufferSize)
|
||||
if readBytes < bufferSize:
|
||||
setLen(result, r+readBytes)
|
||||
break
|
||||
inc r, 1000
|
||||
setLen(result, r+1000)
|
||||
inc r, bufferSize
|
||||
setLen(result, r+bufferSize)
|
||||
|
||||
proc readData*(s, unused: Stream, buffer: pointer,
|
||||
bufLen: int): int {.deprecated.} =
|
||||
|
||||
@@ -1256,7 +1256,7 @@ proc compileOption*(option, arg: string): bool {.
|
||||
## echo "compiled with optimization for size and uses Boehm's GC"
|
||||
|
||||
const
|
||||
hasThreadSupport = compileOption("threads")
|
||||
hasThreadSupport = compileOption("threads") and not defined(nimscript)
|
||||
hasSharedHeap = defined(boehmgc) or defined(gogc) # don't share heaps; every thread has its own
|
||||
taintMode = compileOption("taintmode")
|
||||
|
||||
|
||||
@@ -4,4 +4,7 @@ discard """
|
||||
msg: '''[NimScript] exec: gcc -v'''
|
||||
"""
|
||||
|
||||
when not defined(definedefine):
|
||||
{.fatal: "wrong nim script configuration".}
|
||||
|
||||
echo "hello world!"
|
||||
|
||||
@@ -10,5 +10,6 @@ task listDirs, "lists every subdirectory":
|
||||
echo "DIR ", x
|
||||
|
||||
task default, "default target":
|
||||
--define: definedefine
|
||||
setCommand "c"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user