From dbe65d631e46e1f829d9aee8375614477a8b138e Mon Sep 17 00:00:00 2001 From: Andrea Gilardoni Date: Mon, 4 Mar 2024 16:43:13 +0100 Subject: [PATCH] added include preprocessor for boards compatibility --- src/URLParser.h | 14 ++++++++++++++ src/utility/http_parser.c | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/src/URLParser.h b/src/URLParser.h index eaac7e9..0424592 100644 --- a/src/URLParser.h +++ b/src/URLParser.h @@ -15,6 +15,18 @@ * limitations under the License. */ +/* + * The following class is defined in mbed libraries, in case of STM32H7 include the original library + */ +#if defined __has_include +# if __has_include() +# include +# else +# define NO_HTTP_PARSED +# endif +#endif + +#ifdef NO_HTTP_PARSED #ifndef _MBED_HTTP_PARSED_URL_H_ #define _MBED_HTTP_PARSED_URL_H_ @@ -92,3 +104,5 @@ private: }; #endif // _MBED_HTTP_PARSED_URL_H_ +#endif // NO_HTTP_PARSED +#undef NO_HTTP_PARSED \ No newline at end of file diff --git a/src/utility/http_parser.c b/src/utility/http_parser.c index f1be647..a572a4c 100644 --- a/src/utility/http_parser.c +++ b/src/utility/http_parser.c @@ -1,3 +1,10 @@ +#if defined __has_include +# if ! __has_include() && ! __has_include() +# define NO_HTTP_PARSER +# endif +#endif + +#ifdef NO_HTTP_PARSER /* Based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev * * Additional changes are licensed under the same terms as NGINX and @@ -580,3 +587,5 @@ http_parser_version(void) { HTTP_PARSER_VERSION_MINOR * 0x00100 | HTTP_PARSER_VERSION_PATCH * 0x00001; } + +#endif // NO_HTTP_PARSER \ No newline at end of file