mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-21 09:19:31 +08:00
3ef4f00d5a
Split lib/ into nasmlib/ (for nasm-specific functions) and stdlib/ (for replacements for C library functions which may be missing.) Rename the ersatz inttypes.h to nasmint.h so we can use a simple test in compiler.h instead of dealing with include path magic. Remove tests in configure.in for ancient missing functions (which will break the build anyway.) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
30 lines
439 B
C
30 lines
439 B
C
/*
|
|
* snprintf()
|
|
*
|
|
* Implement snprintf() in terms of vsnprintf()
|
|
*/
|
|
|
|
#include "compiler.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <stdarg.h>
|
|
|
|
#include "nasmlib.h"
|
|
|
|
#if !defined(HAVE_SNPRINTF) && !defined(HAVE__SNPRINTF)
|
|
|
|
int snprintf(char *str, size_t size, const char *format, ...)
|
|
{
|
|
va_list ap;
|
|
int rv;
|
|
|
|
va_start(ap, format);
|
|
rv = vsnprintf(str, size, format, ap);
|
|
va_end(ap);
|
|
|
|
return rv;
|
|
}
|
|
|
|
#endif
|