1
0
mirror of https://github.com/arduino-libraries/ArduinoHttpClient.git synced 2025-04-19 21:22:15 +03:00

added include preprocessor for boards compatibility

This commit is contained in:
Andrea Gilardoni 2024-03-04 16:43:13 +01:00
parent 8d44059cd5
commit dbe65d631e
2 changed files with 23 additions and 0 deletions

View File

@ -15,6 +15,18 @@
* limitations under the License. * 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(<utility/http_parsed_url.h>)
# include <utility/http_parsed_url.h>
# else
# define NO_HTTP_PARSED
# endif
#endif
#ifdef NO_HTTP_PARSED
#ifndef _MBED_HTTP_PARSED_URL_H_ #ifndef _MBED_HTTP_PARSED_URL_H_
#define _MBED_HTTP_PARSED_URL_H_ #define _MBED_HTTP_PARSED_URL_H_
@ -92,3 +104,5 @@ private:
}; };
#endif // _MBED_HTTP_PARSED_URL_H_ #endif // _MBED_HTTP_PARSED_URL_H_
#endif // NO_HTTP_PARSED
#undef NO_HTTP_PARSED

View File

@ -1,3 +1,10 @@
#if defined __has_include
# if ! __has_include(<utility/http_parser/http_parser.h>) && ! __has_include(<http_parser.h>)
# define NO_HTTP_PARSER
# endif
#endif
#ifdef NO_HTTP_PARSER
/* Based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev /* Based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev
* *
* Additional changes are licensed under the same terms as NGINX and * 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_MINOR * 0x00100 |
HTTP_PARSER_VERSION_PATCH * 0x00001; HTTP_PARSER_VERSION_PATCH * 0x00001;
} }
#endif // NO_HTTP_PARSER