Merge branch 'devel' of github.com:nim-lang/Nim into devel

This commit is contained in:
Andreas Rumpf 2016-03-04 22:19:19 +01:00
commit 82114b7980
3 changed files with 22 additions and 7 deletions

View file

@ -91,10 +91,25 @@ __clang__
# define NIM_CONST const # define NIM_CONST const
#endif #endif
#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) /*
# define NIM_THREADVAR __declspec(thread) NIM_THREADVAR declaration based on
#else 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 # define NIM_THREADVAR __thread
#else
# error "Cannot define NIM_THREADVAR"
#endif #endif
/* --------------- how int64 constants should be declared: ----------- */ /* --------------- how int64 constants should be declared: ----------- */

View file

@ -18,7 +18,7 @@
## that ``=`` performs a copy of the set. ## that ``=`` performs a copy of the set.
import import
os, hashes, math hashes, math
{.pragma: myShallow.} {.pragma: myShallow.}
when not defined(nimhygiene): when not defined(nimhygiene):

View file

@ -255,13 +255,13 @@ proc `/`*(x: Uri, path: string): Uri =
## Examples: ## Examples:
## ##
## .. code-block:: ## .. 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" ## 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" ## 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" ## assert bar.path == "/foo/bar/baz"
result = x result = x
if result.path[result.path.len-1] == '/': if result.path[result.path.len-1] == '/':