parent
0fecfdb3b8
commit
19b0c23d62
8 changed files with 91 additions and 131 deletions
|
|
@ -38,7 +38,13 @@ proc `$`*(self: GodotString): string =
|
|||
|
||||
proc toGodotString*(s: string): GodotString {.inline.} =
|
||||
## Converts the Nim string into ``GodotString``
|
||||
initGodotString(result, cstring(s), cint(s.len + 1))
|
||||
when (NimMajor, NimMinor, NimPatch) < (0, 19, 0):
|
||||
if s.isNil:
|
||||
initGodotString(result)
|
||||
else:
|
||||
initGodotString(result, cstring(s), cint(s.len + 1))
|
||||
else:
|
||||
initGodotString(result, cstring(s), cint(s.len + 1))
|
||||
|
||||
proc toGodotString*(s: cstring): GodotString {.inline.} =
|
||||
## Converts the cstring into ``GodotString``
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue