Skip to content

Commit 060097b

Browse files
committed
mbedTLS: Fix build without the module on MinGW
The `include/mbedtls/check_config.h` header file has a generic check which requires `MBEDTLS_PLATFORM_C` to be defined on Windows when building with MinGW and ancient MSVC versions. The few mbedTLS files we include in builds without the module don't really require anything from the mbedTLS platform file beside the `mbedtls_platform_zeroize` function which we already override with a custom one by defining `MBEDTLS_PLATFORM_ZEROIZE_ALT`. So we simply add the same check and force the define in such case.
1 parent c951421 commit 060097b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

thirdparty/mbedtls/include/godot_core_mbedtls_config.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,11 @@
5050
#define MBEDTLS_PLATFORM_ZEROIZE_ALT
5151
#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
5252

53+
// This is only to pass a check in the mbedtls check_config.h header, none of
54+
// the files we include as part of the core build uses it anyway, we already
55+
// define MBEDTLS_PLATFORM_ZEROIZE_ALT which is the only relevant function.
56+
#if defined(__MINGW32__)
57+
#define MBEDTLS_PLATFORM_C
58+
#endif
59+
5360
#endif // GODOT_CORE_MBEDTLS_CONFIG_H

0 commit comments

Comments
 (0)