From 03afbe00b99da07940adf143de1c2db5bf0c5336 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 28 Dec 2014 00:52:10 +0100 Subject: minor improvements --- lib/pure/pegs.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/pure') diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim index 8b7554661..7cef0a00d 100644 --- a/lib/pure/pegs.nim +++ b/lib/pure/pegs.nim @@ -1433,7 +1433,7 @@ proc eat(p: var PegParser, kind: TTokKind) = if p.tok.kind == kind: getTok(p) else: pegError(p, tokKindToStr[kind] & " expected") -proc parseExpr(p: var PegParser): Peg +proc parseExpr(p: var PegParser): Peg {.gcsafe.} proc getNonTerminal(p: var PegParser, name: string): NonTerminal = for i in 0..high(p.nonterms): -- cgit 1.4.1-2-gfad0 From a0ad3aa1836902c5c478e57c8fbee75c60a0a155 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 28 Dec 2014 22:24:29 +0100 Subject: work around a regression caused by the new 'echo' implementation --- lib/pure/unittest.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/pure') diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim index 6c0246f8b..21efea3bc 100644 --- a/lib/pure/unittest.nim +++ b/lib/pure/unittest.nim @@ -97,7 +97,9 @@ proc checkpoint*(msg: string) = template fail* = bind checkpoints for msg in items(checkpoints): - echo msg + # this used to be 'echo' which now breaks due to a bug. XXX will revisit + # this issue later. + stdout.writeln msg when not defined(ECMAScript): if abortOnError: quit(1) -- cgit 1.4.1-2-gfad0 From 2d20feb8f1c2f44ba492989f1d05cee915c76edd Mon Sep 17 00:00:00 2001 From: def Date: Mon, 29 Dec 2014 22:27:31 +0100 Subject: Add imports to asynchttpserver example --- lib/pure/asynchttpserver.nim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/pure') diff --git a/lib/pure/asynchttpserver.nim b/lib/pure/asynchttpserver.nim index 0b18e6bcc..4c48350aa 100644 --- a/lib/pure/asynchttpserver.nim +++ b/lib/pure/asynchttpserver.nim @@ -17,6 +17,8 @@ ## as the response body. ## ## .. code-block::nim +## import asynchttpserver, asyncdispatch +## ## var server = newAsyncHttpServer() ## proc cb(req: Request) {.async.} = ## await req.respond(Http200, "Hello World") -- cgit 1.4.1-2-gfad0 From 85c22f334832cc7cf5e2b01a23eb1c1b63189cfe Mon Sep 17 00:00:00 2001 From: Andre Date: Tue, 30 Dec 2014 23:39:43 +0100 Subject: ignore signal SIGPIPE on Darwin --- lib/posix/posix.nim | 4 ++-- lib/pure/rawsockets.nim | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/pure') diff --git a/lib/posix/posix.nim b/lib/posix/posix.nim index deb120372..0498a0e70 100644 --- a/lib/posix/posix.nim +++ b/lib/posix/posix.nim @@ -1570,9 +1570,9 @@ else: when defined(macosx): + # We can't use the NOSIGNAL flag in the ``send`` function, it has no effect var - MSG_HAVEMORE* {.importc, header: "".}: cint - MSG_NOSIGNAL* = MSG_HAVEMORE + MSG_NOSIGNAL* = 0'i32 else: var MSG_NOSIGNAL* {.importc, header: "".}: cint diff --git a/lib/pure/rawsockets.nim b/lib/pure/rawsockets.nim index 62a011999..e23deea5b 100644 --- a/lib/pure/rawsockets.nim +++ b/lib/pure/rawsockets.nim @@ -428,6 +428,10 @@ proc selectWrite*(writefds: var seq[SocketHandle], pruneSocketSet(writefds, (wr)) +# We ignore signal SIGPIPE on Darwin +when defined(macosx): + signal(SIGPIPE, SIG_IGN) + when defined(Windows): var wsa: WSAData if wsaStartup(0x0101'i16, addr wsa) != 0: raiseOSError(osLastError()) -- cgit 1.4.1-2-gfad0 /a> 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99