summary refs log tree commit diff stats
path: root/lib/core/strs.nim
diff options
context:
space:
mode:
authorDaniil Yarancev <21169548+Yardanico@users.noreply.github.com>2018-06-05 21:25:45 +0300
committerGitHub <noreply@github.com>2018-06-05 21:25:45 +0300
commit642641359821b6a63c6cf7edaaa45873b7ea59c7 (patch)
tree627af3020528cb916b3174bd94304307ca875c77 /lib/core/strs.nim
parentfb44c522e6173528efa8035ecc459c84887d0167 (diff)
parent3cbc07ac7877b03c605498760fe198e3200cc197 (diff)
downloadNim-642641359821b6a63c6cf7edaaa45873b7ea59c7.tar.gz
Merge pull request #2 from nim-lang/devel
Update
Diffstat (limited to 'lib/core/strs.nim')
-rw-r--r--lib/core/strs.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/core/strs.nim b/lib/core/strs.nim
index 1958f4974..ff38aef1d 100644
--- a/lib/core/strs.nim
+++ b/lib/core/strs.nim
@@ -12,12 +12,11 @@
 import allocators
 
 type
-  string {.core.} = object
+  string {.core, exportc: "NimStringV2".} = object
     len, cap: int
     data: ptr UncheckedArray[char]
 
-proc nimStringLiteral(x: cstring; len: int): string {.core.} =
-  string(len: len, cap: len, data: x)
+const nimStrVersion {.core.} = 2
 
 template frees(s) = dealloc(s.data, s.cap + 1)
 
@@ -80,7 +79,7 @@ proc newString*(len: int): string =
   if len > 0:
     result.data = alloc0(len+1)
 
-converter toCString(x: string): cstring {.core.} =
+converter toCString(x: string): cstring {.core, inline.} =
   if x.len == 0: cstring"" else: cast[cstring](x.data)
 
 proc newStringOfCap*(cap: int): string =