repair the compiler error of the configuration with Seperating compiler or musl lib

This commit is contained in:
Wang_Weigen
2023-02-28 17:20:39 +08:00
parent ff78fcc100
commit 5ae31a37f3
18 changed files with 325 additions and 22 deletions

View File

@@ -158,7 +158,7 @@ int CircularAreaAppRead(CircularAreaAppType circular_area, uint8_t *output_buffe
{
CA_PARAM_CHECK(circular_area);
CA_PARAM_CHECK(output_buffer);
CHECK(data_length > 0);
CA_CHECK(data_length > 0);
if(CircularAreaAppIsEmpty(circular_area)) {
return -1;
@@ -199,7 +199,7 @@ int CircularAreaAppWrite(CircularAreaAppType circular_area, uint8_t *input_buffe
{
CA_PARAM_CHECK(circular_area);
CA_PARAM_CHECK(input_buffer);
CHECK(data_length > 0);
CA_CHECK(data_length > 0);
if(CircularAreaAppIsFull(circular_area) && (!b_force)) {
return -1;
@@ -248,7 +248,7 @@ static struct CircularAreaAppOps CircularAreaAppOperations =
*/
CircularAreaAppType CircularAreaAppInit(uint32_t circular_area_length)
{
CHECK(circular_area_length > 0);
CA_CHECK(circular_area_length > 0);
circular_area_length = CA_ALIGN_DOWN(circular_area_length, 8);

View File

@@ -29,11 +29,20 @@
extern "C" {
#endif
#define CA_CHECK(TRUE_CONDITION) \
do \
{ \
if(!(TRUE_CONDITION)) { \
printf("%s CHECK condition is false at line[%d] of [%s] func.\n", #TRUE_CONDITION, __LINE__, __func__);\
while(1); \
} \
}while (0)
#define CA_PARAM_CHECK(param) \
do \
{ \
if(param == NULL) { \
KPrintf("PARAM CHECK FAILED ...%s %d %s is NULL.\n", __func__, __LINE__, #param); \
printf("PARAM CHECK FAILED ...%s %d %s is NULL.\n", __func__, __LINE__, #param); \
while(1); \
} \
}while (0)