From 9066f6172690eb061b4816f4d0bc0f6e7bdb41a3 Mon Sep 17 00:00:00 2001 From: Paul Bartell Date: Tue, 14 Mar 2023 13:02:44 -0700 Subject: [PATCH] FreeRTOS_IP.h: Fix build error introduced by 55658e1 in FreeRTOS-Kernel --- source/include/FreeRTOS_IP.h | 28 +++++++++++++++++++++------- test/unit-test/CMakeLists.txt | 14 +++++++++++++- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/source/include/FreeRTOS_IP.h b/source/include/FreeRTOS_IP.h index d8cdf2be1..5114ac8f1 100644 --- a/source/include/FreeRTOS_IP.h +++ b/source/include/FreeRTOS_IP.h @@ -276,14 +276,28 @@ uint32_t FreeRTOS_round_down( uint32_t a, #define pdMS_TO_MIN_TICKS( xTimeInMs ) ipMS_TO_MIN_TICKS( xTimeInMs ) #ifndef pdTRUE_SIGNED - /* Temporary solution: eventually the defines below will appear in 'Source\include\projdefs.h' */ - #define pdTRUE_SIGNED pdTRUE - #define pdFALSE_SIGNED pdFALSE - #define pdTRUE_UNSIGNED ( 1U ) + #define pdTRUE_SIGNED pdTRUE +#endif /* pdTRUE_SIGNED */ + +#ifndef pdFALSE_SIGNED + #define pdFALSE_SIGNED pdFALSE +#endif /* pdFALSE_SIGNED */ + +#ifndef pdTRUE_UNSIGNED + #define pdTRUE_UNSIGNED ( 1U ) +#endif /* pdTRUE_UNSIGNED */ + +#ifndef pdFALSE_UNSIGNED #define pdFALSE_UNSIGNED ( 0U ) - #define ipTRUE_BOOL ( 1 == 1 ) - #define ipFALSE_BOOL ( 1 == 2 ) -#endif +#endif /* pdFALSE_UNSIGNED */ + +#ifndef ipTRUE_BOOL + #define ipTRUE_BOOL ( 1 == 1 ) +#endif /* ipTRUE_BOOL */ + +#ifndef ipFALSE_BOOL + #define ipFALSE_BOOL ( 1 == 2 ) +#endif /* ipFALSE_BOOL */ /* * FULL, UP-TO-DATE AND MAINTAINED REFERENCE DOCUMENTATION FOR ALL THESE diff --git a/test/unit-test/CMakeLists.txt b/test/unit-test/CMakeLists.txt index 18e868a61..59c51ab2f 100644 --- a/test/unit-test/CMakeLists.txt +++ b/test/unit-test/CMakeLists.txt @@ -113,8 +113,20 @@ foreach( file ${TCP_INCLUDES} ) execute_process( COMMAND mv ${CMAKE_BINARY_DIR}/Annexed_TCP/${MODIFIED_FILE}_tmp2.h ${CMAKE_BINARY_DIR}/Annexed_TCP/${MODIFIED_FILE}_tmp.h ) endif() + + # Use this tool to process all conditional declarations. - execute_process( COMMAND unifdefall -U${Guard} -USEND_REPEATED_COUNT -UpdTRUE_SIGNED -UFreeRTOS_htonl -D__COVERITY__ -DTEST -I ${MODULE_ROOT_DIR}/tools/CMock/vendor/unity/src + execute_process( COMMAND unifdefall -U${Guard} -USEND_REPEATED_COUNT + -UpdTRUE_SIGNED + -UpdFALSE_SIGNED + -UpdTRUE_UNSIGNED + -UpdFALSE_UNSIGNED + -UipTRUE_BOOL + -UipFALSE_BOOL + -UFreeRTOS_htonl + -D__COVERITY__ + -DTEST + -I ${MODULE_ROOT_DIR}/tools/CMock/vendor/unity/src -I ${MODULE_ROOT_DIR}/test/FreeRTOS-Kernel/include -I ${UNIT_TEST_DIR}/ConfigFiles -I ${MODULE_ROOT_DIR}/source/include