[update] IMPLEMENTATION_ define once

This commit is contained in:
2026-04-07 14:48:11 +02:00
parent 3975d92651
commit 659b61a5f0
+11 -5
View File
@@ -328,19 +328,16 @@ extern char *varHK_EQ, *varHK_TR, *varHK_RN, *varHK_DN, *varHK_OK, *varHK_FL, *v
free(buf);\ free(buf);\
}while(0) }while(0)
#define LOG(...) PRINTF(__VA_ARGS__) #define LOG(...) PRINTF(__VA_ARGS__)
#define PRINT_LOC(fmt, ...) \ #define PRINT_LOC(fmt, ...) \
PRINTF( "%s:%d:%s(): " fmt, __FILE__, __LINE__, __func__, __VA_ARGS__) PRINTF( "%s:%d:%s(): " fmt, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define PRINT_HK_C(color,hk,fmt,...)\ #define PRINT_HK_C(color,hk,fmt,...)\
PRINTF("%s%s%s" fmt, color,hk,colors_f[k_DEFAULT],__VA_ARGS__) PRINTF("%s%s%s" fmt, color,hk,colors_f[k_DEFAULT],__VA_ARGS__)
#define PRINT_DEBUG(fmt, ...)\ #define PRINT_DEBUG(fmt, ...)\
do{ if(debug) PRINT_LOC(fmt, __VA_ARGS__);} while(0) do{ if(debug) PRINT_LOC(fmt, __VA_ARGS__);} while(0)
/* /*
* to skip the bloc test function * to skip the bloc test function
@@ -350,7 +347,6 @@ extern char *varHK_EQ, *varHK_TR, *varHK_RN, *varHK_DN, *varHK_OK, *varHK_FL, *v
PRINT_LOC("%s\n\n" DEFAULT_K," Skiped "); return; PRINT_LOC("%s\n\n" DEFAULT_K," Skiped "); return;
struct func { struct func {
char *name; char *name;
void (*run)(void); void (*run)(void);
@@ -1147,7 +1143,9 @@ do{
#include "ftest/ftest.h" #include "ftest/ftest.h"
#ifndef min
#define min(a,b) (((a)<(b)) ? (a) : (b)) #define min(a,b) (((a)<(b)) ? (a) : (b))
#endif
/* /*
* only expect * only expect
@@ -2054,6 +2052,7 @@ __attribute__((constructor)) void create_str_print_variables ## namefunction(){\
#ifndef IMPLEMENTATION_TOOLS
#define IMPLEMENTATION_TOOLS()\ #define IMPLEMENTATION_TOOLS()\
\ \
GEN_TO_STR_N(TYPE_CHAR,2,"%c")\ GEN_TO_STR_N(TYPE_CHAR,2,"%c")\
@@ -2173,9 +2172,10 @@ long diff_timespec_nanoseconds(struct timespec time_stop, struct timespec time_s
}\ }\
\ \
#endif /* IMPLEMENTATION_TOOLS */
#ifndef IMPLEMENTATION_PROGRESS_BAR
#define IMPLEMENTATION_PROGRESS_BAR()\ #define IMPLEMENTATION_PROGRESS_BAR()\
\ \
static struct winsize w;\ static struct winsize w;\
@@ -2325,6 +2325,8 @@ void bar_progress_stop()\
set_window_height_for_bar_progress(w.ws_row);\ set_window_height_for_bar_progress(w.ws_row);\
}\ }\
#endif /* IMPLEMENTATION_PROGRESS_BAR */
/* implementation ftest */ /* implementation ftest */
@@ -2698,6 +2700,7 @@ bool is_in_array_##type(type *array, type val){\
#ifndef IMPLEMENTATION_FTEST
#define IMPLEMENTATION_FTEST() \ #define IMPLEMENTATION_FTEST() \
\ \
IMPLEMENTATION_TOOLS()\ IMPLEMENTATION_TOOLS()\
@@ -3914,6 +3917,7 @@ purge_tests() \
\ \
} \ } \
#endif /* IMPLEMENTATION_FTEST */
/* implementation fmock */ /* implementation fmock */
@@ -3951,6 +3955,7 @@ purge_tests() \
//char *colors_f[]={DEFAULT_K, RED_K, GREEN_K, YELLOW_K, BLUE_K, ""}; //char *colors_f[]={DEFAULT_K, RED_K, GREEN_K, YELLOW_K, BLUE_K, ""};
#ifndef IMPLEMENTATION_FMOCK
#define IMPLEMENTATION_FMOCK() \ #define IMPLEMENTATION_FMOCK() \
\ \
size_t count_f_mock_wished=0; \ size_t count_f_mock_wished=0; \
@@ -4338,3 +4343,4 @@ __attribute__((destructor)) \
\ \
} \ } \
#endif /* IMPLEMENTATION_FMOCK */