mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
gg: image: return an optional instead of panic(); darwin: fix nsstring()
This commit is contained in:
@ -113,11 +113,27 @@ pub fn print(s string) {
|
||||
const (
|
||||
new_line_character = '\n'
|
||||
)
|
||||
|
||||
//#include "@VROOT/vlib/darwin/darwin.m"
|
||||
|
||||
//fn C.nsstring2(s string) voidptr
|
||||
//fn C.NSLog(x voidptr)
|
||||
#include <asl.h>
|
||||
|
||||
|
||||
fn C.asl_log(voidptr, voidptr, int, charptr)
|
||||
|
||||
pub fn println(s string) {
|
||||
$if windows {
|
||||
print(s)
|
||||
print(new_line_character)
|
||||
} $else {
|
||||
// For debugging .app applications (no way to read stdout) so that it's printed to macOS Console
|
||||
/*
|
||||
$if macos {
|
||||
C.asl_log(0, 0, C.ASL_LEVEL_ERR, s.str)
|
||||
}
|
||||
*/
|
||||
// TODO: a syscall sys_write on linux works, except for the v repl.
|
||||
// Probably it is a stdio buffering issue. Needs more testing...
|
||||
// $if linux {
|
||||
|
Reference in New Issue
Block a user