1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: small fixes + some logic for freeing strings

This commit is contained in:
Alexander Medvednikov
2019-09-24 22:30:30 +03:00
parent b1f0df0fd1
commit 04e4018228
8 changed files with 78 additions and 45 deletions

View File

@ -6,8 +6,7 @@ module darwin
struct C.NSString { }
// macOS and iOS helpers
pub fn nsstring(s string) *NSString {
// #return @"" ;
pub fn nsstring(s string) *C.NSString {
// println('ns $s len=$s.len')
# return [ [ NSString alloc ] initWithBytesNoCopy:s.str length:s.len
# encoding:NSUTF8StringEncoding freeWhenDone: false];
@ -16,7 +15,5 @@ pub fn nsstring(s string) *NSString {
//ns := C.alloc_NSString()
//return ns.initWithBytesNoCopy(s.str, length: s.len,
//encoding: NSUTF8StringEncoding, freeWhenDone: false)
}