From: William Lallemand Date: Mon, 6 Oct 2025 07:26:36 +0000 (+0200) Subject: CLEANUP: mjson: remove unused defines from mjson.h X-Git-Tag: v3.3-dev10~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69bd253b23260dd77b1bcb8c40032ff2ba530f93;p=thirdparty%2Fhaproxy.git CLEANUP: mjson: remove unused defines from mjson.h This patch removes unused defines from mjson.h. It also removes unused c++ declarations and includes. string.h is moved to mjson.c --- diff --git a/include/import/mjson.h b/include/import/mjson.h index 1d4583ac2..043ca2b69 100644 --- a/include/import/mjson.h +++ b/include/import/mjson.h @@ -22,50 +22,6 @@ #ifndef MJSON_H #define MJSON_H -#include -#include -#include - -#ifndef MJSON_ENABLE_PRINT -#define MJSON_ENABLE_PRINT 1 -#endif - -#ifndef MJSON_ENABLE_RPC -#define MJSON_ENABLE_RPC 1 -#endif - -#ifndef MJSON_ENABLE_BASE64 -#define MJSON_ENABLE_BASE64 1 -#endif - -#ifndef MJSON_ENABLE_MERGE -#define MJSON_ENABLE_MERGE 0 -#elif MJSON_ENABLE_MERGE -#define MJSON_ENABLE_NEXT 1 -#endif - -#ifndef MJSON_ENABLE_PRETTY -#define MJSON_ENABLE_PRETTY 0 -#elif MJSON_ENABLE_PRETTY -#define MJSON_ENABLE_NEXT 1 -#endif - -#ifndef MJSON_ENABLE_NEXT -#define MJSON_ENABLE_NEXT 0 -#endif - -#ifndef MJSON_RPC_LIST_NAME -#define MJSON_RPC_LIST_NAME "rpc.list" -#endif - -#ifndef MJSON_DYNBUF_CHUNK -#define MJSON_DYNBUF_CHUNK 256 // Allocation granularity for print_dynamic_buf -#endif - -#ifdef __cplusplus -extern "C" { -#endif - enum { MJSON_ERROR_INVALID_INPUT = -1, MJSON_ERROR_TOO_DEEP = -2, @@ -98,7 +54,4 @@ int mjson_get_bool(const char *s, int len, const char *path, int *v); int mjson_get_string(const char *s, int len, const char *path, char *to, int n); int mjson_get_hex(const char *s, int len, const char *path, char *to, int n); -#ifdef __cplusplus -} -#endif #endif // MJSON_H diff --git a/src/mjson.c b/src/mjson.c index 3214a5bf1..a36fe185f 100644 --- a/src/mjson.c +++ b/src/mjson.c @@ -20,6 +20,7 @@ // SOFTWARE. #include +#include #include