Skip to content

Commit d0a2597

Browse files
author
Arto Kinnunen
authored
Fix IAR compilation error with NUCLEO_F401RE (#86)
Include mbedtls config files before including ssl.h to avoid error: "mbedtls\ssl.h",384 Error[Pe169]: expected a declaration"
1 parent 674a465 commit d0a2597

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

source/include/coap_security_handler.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,18 @@
2020
#include "ns_types.h"
2121

2222
#ifdef NS_USE_EXTERNAL_MBED_TLS
23+
#if !defined(MBEDTLS_CONFIG_FILE)
24+
#include "mbedtls/config.h"
25+
#else
26+
#include MBEDTLS_CONFIG_FILE
27+
#endif
28+
29+
#if defined(MBEDTLS_SSL_TLS_C)
2330
#include "mbedtls/ssl.h"
24-
#ifdef MBEDTLS_SSL_TLS_C
2531
#define COAP_SECURITY_AVAILABLE
2632
#endif
27-
#endif
33+
34+
#endif /* NS_USE_EXTERNAL_MBED_TLS */
2835

2936
#define COOKIE_SIMPLE_LEN 8
3037
typedef struct simple_cookie {

0 commit comments

Comments
 (0)