Introduce format attribute
This commit is contained in:
parent
3cdf224b90
commit
31673c0ac9
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include <Format.h>
|
||||
#include <Types.h>
|
||||
|
||||
namespace Serial
|
||||
@ -7,5 +8,5 @@ namespace Serial
|
||||
void write(const char* str, usize size);
|
||||
void print(const char* str);
|
||||
void println(const char* str);
|
||||
int printf(const char* str, ...);
|
||||
int printf(const char* str, ...) _format(1, 2);
|
||||
}
|
@ -3,6 +3,8 @@
|
||||
#include <Types.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define _format(n, m) __attribute__((format(printf, n, m)))
|
||||
|
||||
typedef int (*callback_t)(char, void*);
|
||||
|
||||
isize cstyle_format(const char* format, callback_t callback, void* arg, va_list ap);
|
Loading…
Reference in New Issue
Block a user