Skip to content

Commit dbe65d6

Browse files
added include preprocessor for boards compatibility
1 parent 8d44059 commit dbe65d6

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Diff for: src/URLParser.h

+14
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@
1515
* limitations under the License.
1616
*/
1717

18+
/*
19+
* The following class is defined in mbed libraries, in case of STM32H7 include the original library
20+
*/
21+
#if defined __has_include
22+
# if __has_include(<utility/http_parsed_url.h>)
23+
# include <utility/http_parsed_url.h>
24+
# else
25+
# define NO_HTTP_PARSED
26+
# endif
27+
#endif
28+
29+
#ifdef NO_HTTP_PARSED
1830
#ifndef _MBED_HTTP_PARSED_URL_H_
1931
#define _MBED_HTTP_PARSED_URL_H_
2032

@@ -92,3 +104,5 @@ class ParsedUrl {
92104
};
93105

94106
#endif // _MBED_HTTP_PARSED_URL_H_
107+
#endif // NO_HTTP_PARSED
108+
#undef NO_HTTP_PARSED

Diff for: src/utility/http_parser.c

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#if defined __has_include
2+
# if ! __has_include(<utility/http_parser/http_parser.h>) && ! __has_include(<http_parser.h>)
3+
# define NO_HTTP_PARSER
4+
# endif
5+
#endif
6+
7+
#ifdef NO_HTTP_PARSER
18
/* Based on src/http/ngx_http_parse.c from NGINX copyright Igor Sysoev
29
*
310
* Additional changes are licensed under the same terms as NGINX and
@@ -580,3 +587,5 @@ http_parser_version(void) {
580587
HTTP_PARSER_VERSION_MINOR * 0x00100 |
581588
HTTP_PARSER_VERSION_PATCH * 0x00001;
582589
}
590+
591+
#endif // NO_HTTP_PARSER

0 commit comments

Comments
 (0)