Merge remote-tracking branch 'origin/devel' into bitsize-pragma

This commit is contained in:
Aman Gupta
2015-09-30 11:43:59 -07:00
6 changed files with 27 additions and 9 deletions

View File

@@ -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

View File

@@ -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")

View File

@@ -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.} =

View File

@@ -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")

View File

@@ -4,4 +4,7 @@ discard """
msg: '''[NimScript] exec: gcc -v'''
"""
when not defined(definedefine):
{.fatal: "wrong nim script configuration".}
echo "hello world!"

View File

@@ -10,5 +10,6 @@ task listDirs, "lists every subdirectory":
echo "DIR ", x
task default, "default target":
--define: definedefine
setCommand "c"