From 0838b2be142e3325ec86e1d795c6d3d1ead13277 Mon Sep 17 00:00:00 2001 From: chses910372 Date: Mon, 17 Feb 2020 21:46:21 +0800 Subject: [PATCH] Modify redefinition of strdup If the glibc version < 2.26.There are two definitions of strdup in harness.h and string2.h. This will cause a redefined error when compile. Using macro #undef to undef the strdup defined in string2.h:1291. --- harness.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/harness.h b/harness.h index 3956b7003..ccb7125d5 100644 --- a/harness.h +++ b/harness.h @@ -63,6 +63,9 @@ void trigger_exception(char *msg); /* Tested program use our versions of malloc and free */ #define malloc test_malloc #define free test_free + +/* Use undef to avoid strdup redefined error */ +#undef strdup #define strdup test_strdup #endif