File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,12 +21,31 @@ struct Mem
2121struct Sys
2222{
2323 static import core.stdc.stdlib ;
24+ import core.stdc.stdio ;
2425
2526 alias abort = core.stdc.stdlib.abort ;
27+
28+ // Assumes str is null-terminated string
29+ static void print (scope const char [] str) nothrow @nogc
30+ {
31+ auto r = fputs(str.ptr, stdout);
32+ if (r < 0 )
33+ Sys.abort();
34+ }
35+
36+ // ~ void print(T)(scope const char[] str, T vals) nothrow @nogc
37+ // ~ {
38+ // ~ // Assume str is null-terminated string
39+ // ~ auto r = fputs(str.ptr, stdout);
40+ // ~ if(r < 0)
41+ // ~ Sys.abort();
42+ // ~ }
43+
44+ // ~ alias format = snprintf
2645}
2746
28- // Special case: we don't have resources to implement formatting functionality
29- // for now just for the sake of using it at debugging
47+ // Special case: we don't have resources to implement mature formatting
48+ // functionality for now just for the sake of using it at debugging
3049debug
3150{
3251 static import core.stdc.stdio ;
You can’t perform that action at this time.
0 commit comments