Skip to content

Commit 46e0b1c

Browse files
committed
Use dummy typedef instead of macro
Use a dummy definition of mbedtls_ms_time_t in builds without MBEDTLS_HAVE_TIME. Signed-off-by: Bence Szépkúti <[email protected]>
1 parent 011b6cb commit 46e0b1c

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

tests/suites/test_suite_debug.data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ printf "%" MBEDTLS_PRINTF_LONGLONG, 0
66
printf_int_expr:(uintptr_t) "%" MBEDTLS_PRINTF_LONGLONG:sizeof(long long):0:"0"
77

88
printf "%" MBEDTLS_PRINTF_MS_TIME, 0
9-
printf_int_expr:(uintptr_t) "%" MBEDTLS_PRINTF_MS_TIME:MBEDTLS_MS_TIME_SIZE:0:"0"
9+
printf_int_expr:(uintptr_t) "%" MBEDTLS_PRINTF_MS_TIME:sizeof(mbedtls_ms_time_t):0:"0"
1010

1111
Debug print msg (threshold 1, level 0)
1212
debug_print_msg_threshold:1:0:"MyFile":999:"MyFile(0999)\: Text message, 2 == 2\n"

tests/suites/test_suite_debug.function

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@
99
# include <crtdbg.h>
1010
#endif
1111

12-
// Use a macro instead of sizeof(mbedtls_ms_time_t) because the expression store
13-
// doesn't exclude entries based on depends_on headers, which would cause failures
14-
// in builds without MBEDTLS_HAVE_TIME
15-
#if defined(MBEDTLS_PLATFORM_MS_TIME_TYPE_MACRO)
16-
# define MBEDTLS_MS_TIME_SIZE sizeof(MBEDTLS_PLATFORM_MS_TIME_TYPE_MACRO)
17-
#else
18-
# define MBEDTLS_MS_TIME_SIZE sizeof(int64_t)
12+
// Dummy type for builds without MBEDTLS_HAVE_TIME
13+
#if !defined(MBEDTLS_HAVE_TIME)
14+
typedef int64_t mbedtls_ms_time_t;
1915
#endif
2016

2117
struct buffer_data {

0 commit comments

Comments
 (0)