Check if feature macro is defined before define it

Zephyr's native posix port define _POSIX_C_SOURCE with a higher value
during the build, so when mbedTLS defines it with a different value
breaks the build.

As Zephyr is already defining a higher value is guaranteed that mbedTLS
required features will be available. So, just define it in case it was
not defined before.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Flavio Ceolin 2020-05-27 22:41:19 -07:00 committed by Ioannis Glaropoulos
parent f482bbddeb
commit 711fe7fdff
1 changed files with 2 additions and 0 deletions

View File

@ -20,7 +20,9 @@
/* Enable definition of getaddrinfo() even when compiling with -std=c99. Must
* be set before config.h, which pulls in glibc's features.h indirectly.
* Harmless on other platforms. */
#if !defined(_POSIX_C_SOURCE)
#define _POSIX_C_SOURCE 200112L
#endif
#define _XOPEN_SOURCE 600 /* sockaddr_storage */
#include "common.h"