From 1a1710c3ec688e5d3975561334801b86f47288f3 Mon Sep 17 00:00:00 2001 From: Anatoly Galiulin Date: Tue, 1 Mar 2016 17:23:10 +0600 Subject: [PATCH 1/3] Fixed NIM_THREADVAR definition in nimbase.h --- lib/nimbase.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/nimbase.h b/lib/nimbase.h index 40ea6c66a..266b84b09 100644 --- a/lib/nimbase.h +++ b/lib/nimbase.h @@ -91,10 +91,25 @@ __clang__ # define NIM_CONST const #endif -#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) -# define NIM_THREADVAR __declspec(thread) -#else +/* + NIM_THREADVAR declaration based on + http://stackoverflow.com/questions/18298280/how-to-declare-a-variable-as-thread-local-portably +*/ +#if __STDC_VERSION__ >= 201112 && !defined __STDC_NO_THREADS__ +# define NIM_THREADVAR _Thread_local +#elif defined _WIN32 && ( \ + defined _MSC_VER || \ + defined __ICL || \ + defined __DMC__ || \ + defined __BORLANDC__ ) +# define NIM_THREADVAR __declspec(thread) +/* note that ICC (linux) and Clang are covered by __GNUC__ */ +#elif defined __GNUC__ || \ + defined __SUNPRO_C || \ + defined __xlC__ # define NIM_THREADVAR __thread +#else +# error "Cannot define NIM_THREADVAR" #endif /* --------------- how int64 constants should be declared: ----------- */ From f77bc7d93a48d21b98d195b718aad35945a3ffaa Mon Sep 17 00:00:00 2001 From: CORDEA Date: Wed, 2 Mar 2016 20:55:02 +0900 Subject: [PATCH 2/3] Fixed an wrong example of the doc --- lib/pure/uri.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pure/uri.nim b/lib/pure/uri.nim index abb1a462d..f0a3796a5 100644 --- a/lib/pure/uri.nim +++ b/lib/pure/uri.nim @@ -255,13 +255,13 @@ proc `/`*(x: Uri, path: string): Uri = ## Examples: ## ## .. code-block:: - ## let foo = parseUri("http://example.com/foo/bar") / parseUri("/baz") + ## let foo = parseUri("http://example.com/foo/bar") / "/baz" ## assert foo.path == "/foo/bar/baz" ## - ## let bar = parseUri("http://example.com/foo/bar") / parseUri("baz") + ## let bar = parseUri("http://example.com/foo/bar") / "baz" ## assert bar.path == "/foo/bar/baz" ## - ## let bar = parseUri("http://example.com/foo/bar/") / parseUri("baz") + ## let bar = parseUri("http://example.com/foo/bar/") / "baz" ## assert bar.path == "/foo/bar/baz" result = x if result.path[result.path.len-1] == '/': From bbf12aab4f79508a9331bd4b67c4eb75e0ea8462 Mon Sep 17 00:00:00 2001 From: Rostyslav Dzinko Date: Fri, 4 Mar 2016 11:34:27 +0200 Subject: [PATCH 3/3] Removed unused import of 'os' module from module 'sets' --- lib/pure/collections/sets.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim index aa4919884..20f73ded3 100644 --- a/lib/pure/collections/sets.nim +++ b/lib/pure/collections/sets.nim @@ -18,7 +18,7 @@ ## that ``=`` performs a copy of the set. import - os, hashes, math + hashes, math {.pragma: myShallow.} when not defined(nimhygiene):