File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -164,9 +164,10 @@ pub fn eprint(s string) {
164
164
// print prints a message to stdout. Unlike `println` stdout is not automatically flushed.
165
165
// A call to `flush()` will flush the output buffer to stdout.
166
166
pub fn print (s string ) {
167
- $if android {
167
+ $if android { // android print for logcat
168
168
C.fprintf (C.stdout, c '%.*s' , s.len, s.str)
169
- } $else $if ios {
169
+ }
170
+ $if ios { // no else if because we also need console output on android
170
171
// TODO: Implement a buffer as NSLog doesn't have a "print"
171
172
C.WrappedNSLog (s.str)
172
173
} $else $if freestanding {
@@ -190,9 +191,10 @@ pub fn println(s string) {
190
191
}
191
192
return
192
193
}
193
- $if android {
194
+ $if android { // android print for logcat
194
195
C.fprintf (C.stdout, c '%.*s\n ' , s.len, s.str)
195
- } $else $if ios {
196
+ }
197
+ $if ios { // no else if because we also need console output on android
196
198
C.WrappedNSLog (s.str)
197
199
} $else $if freestanding {
198
200
bare_print (s.str, u64 (s.len))
You can’t perform that action at this time.
0 commit comments