mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 01:48:29 -04:00
HAL_ChibiOS: wrap sscanf and snprintf methods
This commit is contained in:
parent
05539cd93b
commit
6622c9b8fd
@ -335,6 +335,6 @@ def build(bld):
|
|||||||
|
|
||||||
bld.env.LIB += ['ch']
|
bld.env.LIB += ['ch']
|
||||||
bld.env.LIBPATH += ['modules/ChibiOS/']
|
bld.env.LIBPATH += ['modules/ChibiOS/']
|
||||||
wraplist = ['strerror_r', 'fclose', 'freopen', 'fread', 'fprintf']
|
wraplist = ['strerror_r', 'fclose', 'freopen', 'fread', 'fprintf', 'sscanf', 'snprintf']
|
||||||
for w in wraplist:
|
for w in wraplist:
|
||||||
bld.env.LINKFLAGS += ['-Wl,--wrap,%s' % w]
|
bld.env.LINKFLAGS += ['-Wl,--wrap,%s' % w]
|
@ -68,7 +68,7 @@ int vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
int snprintf(char *str, size_t size, const char *fmt, ...)
|
int __wrap_snprintf(char *str, size_t size, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
#ifndef HAL_NO_PRINTF
|
#ifndef HAL_NO_PRINTF
|
||||||
va_list arg;
|
va_list arg;
|
||||||
@ -165,7 +165,7 @@ scanf (const char *fmt, ...)
|
|||||||
* sscanf(buf,fmt,va_alist)
|
* sscanf(buf,fmt,va_alist)
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
sscanf (const char *buf, const char *fmt, ...)
|
__wrap_sscanf (const char *buf, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
@ -25,7 +25,8 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int vsnprintf(char *str, size_t size, const char *fmt, va_list ap);
|
int vsnprintf(char *str, size_t size, const char *fmt, va_list ap);
|
||||||
int snprintf(char *str, size_t size, const char *fmt, ...);
|
int __wrap_snprintf(char *str, size_t size, const char *fmt, ...);
|
||||||
|
int snprintf(char *str, size_t size, const char *fmt, ...); //undefined, only used as a placeholder, its replaced by wrap method at link time
|
||||||
int vasprintf(char **strp, const char *fmt, va_list ap);
|
int vasprintf(char **strp, const char *fmt, va_list ap);
|
||||||
int asprintf(char **strp, const char *fmt, ...);
|
int asprintf(char **strp, const char *fmt, ...);
|
||||||
int vprintf(const char *fmt, va_list arg);
|
int vprintf(const char *fmt, va_list arg);
|
||||||
@ -35,7 +36,8 @@ int fscanf ( FILE * stream, const char * format, ... );
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int scanf (const char *fmt, ...);
|
int scanf (const char *fmt, ...);
|
||||||
int sscanf (const char *buf, const char *fmt, ...);
|
int __wrap_sscanf (const char *buf, const char *fmt, ...);
|
||||||
|
int sscanf (const char *buf, const char *fmt, ...); //undefined, only used as a placeholder, its replaced by wrap method at link time
|
||||||
int vsscanf (const char *buf, const char *s, va_list ap);
|
int vsscanf (const char *buf, const char *s, va_list ap);
|
||||||
void *malloc(size_t size);
|
void *malloc(size_t size);
|
||||||
void *calloc(size_t nmemb, size_t size);
|
void *calloc(size_t nmemb, size_t size);
|
||||||
|
Loading…
Reference in New Issue
Block a user