New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check time platform abstraction macro definitions #534
Check time platform abstraction macro definitions #534
Conversation
35c1cb9
to
6d7a4c0
Compare
This patch adds some checks to check_config.h to ensure that macro definitions for the time platform abstraction are acceptable. In this case the requirements are: - MBEDTLS_PLATFORM_C and MBEDTLS_HAVE_TIME must be defined whenever MBEDTLS_PLATFORM_TIME_ALT, MBEDTLS_PLATFORM_TIME_TYPE_MACRO or MBEDTLS_PLATFORM_TIME_MACRO is defined. - MBEDTLS_PLATFORM_STD_TIME and MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously with MBEDTLS_PLATFORM_TIME_TYPE_MACRO or MBEDTLS_PLATFORM_TIME_MACRO. - MBEDTLS_HAVE_TIME and MBEDTLS_PLATFORM_TIME_ALT must be defined whenever MBEDTLS_PLATFORM_STD_TIME is defined.
Document that time platform abstraction macros MBEDTLS_PLATFORM_TIME_ALT, MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME require MBEDTLS_HAVE_TIME to be defined in config.h.
781ac04
to
c38b903
Compare
@yanesca @sbutcher-arm |
Why is MBEDTLS_PLATFORM_C a prerequisite for MBEDTLS_PLATFORM_TIME_TYPE_MACRO? |
Why is the following condition necessary? |
( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ | ||
defined(MBEDTLS_PLATFORM_TIME_ALT) ) | ||
#error "MBEDTLS_PLATFORM_TIME_MACRO/MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer to have this condition separated, like the other one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this check is more complex than the other ones because we need to check both MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_TIME_TYPE_MACRO. I put them both in th same check because they are really related.
+1 |
1 similar comment
+1 |
The last commit splits the rather complex condition in check_config.h into two separate preprocessor conditions for simplicity as suggested by @yanesca. |
Reviewed and approved for merge, |
Bump Mbed TLS Version to 2.1.16
…6.04 ci: fix meson build on ubuntu 16.04
This patch adds some checks to check_config.h to ensure that macro
definitions for the time platform abstraction are acceptable. In this
case the requirements are:
MBEDTLS_PLATFORM_TIME_ALT, MBEDTLS_PLATFORM_TIME_TYPE_MACRO or
MBEDTLS_PLATFORM_TIME_MACRO is defined.
defined simultaneously with MBEDTLS_PLATFORM_TIME_TYPE_MACRO or
MBEDTLS_PLATFORM_TIME_MACRO.