Skip to content

Commit

Permalink
Modify redefinition of strdup
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chses9440611 committed Feb 19, 2020
1 parent a5fa0bf commit 0838b2b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions harness.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0838b2b

Please sign in to comment.