Make stdarg an optional header. Some works remain to do to make stdio fully optional

This commit is contained in:
Patrick Pelissier committed 2021-01-10 09:40:37 +01:00
1 parent 3df2408ffb
commit 5f05c1e169
2 files changed
+25 -6

No files matched your search

+13 -1
View File
@@ -29,7 +29,6 @@
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
@@ -44,6 +43,15 @@
# include <stdio.h>
#endif
/* By default, always use stdarg. Can be turned off in specific environement if needed
by defining M_USE_STDARG to 0 */
#ifndef M_USE_STDARG
# define M_USE_STDARG 1
#endif
#if M_USE_STDARG
# include <stdarg.h>
#endif
/***************************************************************/
/************************ Compiler Macro ***********************/
@@ -2054,6 +2062,8 @@ M_PARSE_DEFAULT_TYPE_DEF(m_core_parse_ldouble, long double, strtold, )
#endif
#if M_USE_STDARG
/* Define the allocation of the temporary string used by M_CSTR
Default is 256 bytes (so 255 characters excluding the final null char).
It can be overriden by users if needed.
@@ -2123,6 +2133,8 @@ m_core_snprintf(char *str, size_t size, const char *format, ...)
#endif
#endif // Have stdarg
/************************************************************/
/********************* HASH selection ***********************/