diff --git a/libft/FT_SPLIT_TESTER.patch b/libft/FT_SPLIT_TESTER.patch new file mode 100644 index 0000000..570d815 --- /dev/null +++ b/libft/FT_SPLIT_TESTER.patch @@ -0,0 +1,39 @@ +--- a/Makefile ++++ b/Makefile +@@ -14,7 +14,7 @@ CC = gcc + + CFLAGS = -Wall -Wextra -Werror + +-SRC = ../*.c \ ++SRC = ../libft/ft_split.c ../libft/ft_bzero.c ../libft/ft_calloc.c ../libft/ft_memcpy.c ../libft/ft_memset.c ../libft/ft_strlen.c \ + ft_compare_results.c \ + ft_mem_count.c \ + ft_my_split.c \ +--- a/ft.h ++++ b/ft.h +@@ -13,15 +13,24 @@ + #ifndef FT_H + # define FT_H + ++#include ++ + //for MacOS, MALLOC_SIZE_FUNCTION Macro should be malloc_size + //for Windows, MALLOC_SIZE_FUNCTION Macro should be _msize + //for GLIBC systems, MALLOC_SIZE_FUNCTION Macro should be malloc_usable_size ++#ifdef __GNU_LIBRARY__ ++#define MALLOC_SIZE_FUNCTION malloc_usable_size ++#else + #define MALLOC_SIZE_FUNCTION malloc_size ++#endif + + //For Windows/GLIBC next #include should be "#include " + //For MacOs next #include should be #include ++#ifdef __GNU_LIBRARY__ ++#include ++#else + #include +- ++#endif + + //Includes + #include diff --git a/libft/Makefile b/libft/Makefile index 583a65a..3d3a0d3 100644 --- a/libft/Makefile +++ b/libft/Makefile @@ -119,6 +119,7 @@ e: fast _libft-unit-test @make -C libft-unit-test b || true _FT_SPLIT_TESTER: + @patch -d FT_SPLIT_TESTER -p1 --dry-run < FT_SPLIT_TESTER.patch >/dev/null 2>&1 && patch -d FT_SPLIT_TESTER -p1 < FT_SPLIT_TESTER.patch || true @grep -q '../*.c' FT_SPLIT_TESTER/Makefile && sed -i'.orig' -e 's/\.\.\/\*\.c/..\/libft\/ft_split.c ..\/libft\/ft_bzero.c ..\/libft\/ft_calloc.c ..\/libft\/ft_memcpy.c ..\/libft\/ft_memset.c ..\/libft\/ft_strlen.c/' FT_SPLIT_TESTER/Makefile || true f: compile _FT_SPLIT_TESTER