> compile NEMU

221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 11:41:37 up  1:55,  1 user,  load average: 0.66, 0.82, 0.78
This commit is contained in:
tracer-ics2023
2024-09-12 11:41:37 +08:00
committed by zzy
parent b5678f1258
commit 4ef1992a61

View File

@ -6,16 +6,13 @@
#if !defined(__ISA_NATIVE__) || defined(__NATIVE_USE_KLIB__)
int printf(const char *fmt, ...) {
// assert(0);
// va_list ap;
// va_start(ap, fmt);
// char buf[1024] = { 0 };
// int ret = vsnprintf(buf, sizeof(buf), fmt, ap);
// putstr(buf);
// va_end(ap);
// return ret;
// panic("Not implemented");
return 0;
va_list ap;
va_start(ap, fmt);
char buf[1024] = { 0 };
int ret = vsnprintf(buf, sizeof(buf), fmt, ap);
putstr(buf);
va_end(ap);
return ret;
}
int vsprintf(char *out, const char *fmt, va_list ap) {
@ -32,12 +29,11 @@ int sprintf(char *out, const char *fmt, ...) {
}
int snprintf(char *out, size_t n, const char *fmt, ...) {
// va_list ap;
// va_start(ap, fmt);
// int ret = vsnprintf(out, n, fmt, ap);
// va_end(ap);
// return ret;
return 0;
va_list ap;
va_start(ap, fmt);
int ret = vsnprintf(out, n, fmt, ap);
va_end(ap);
return ret;
}
static int rvsnprintf(char* out, size_t n, const char* fmt, va_list ap);