Files
42test/libft/FT_SPLIT_TESTER.patch

47 lines
1.0 KiB
Diff
Raw Permalink Normal View History

2021-10-27 11:03:34 +00:00
--- a/Makefile
+++ b/Makefile
2021-10-29 17:50:09 +02:00
@@ -14,13 +14,14 @@ CC = gcc
2021-10-27 11:03:34 +00:00
CFLAGS = -Wall -Wextra -Werror
-SRC = ../*.c \
2021-10-29 17:50:09 +02:00
+SRC = \
2021-10-27 11:03:34 +00:00
ft_compare_results.c \
ft_mem_count.c \
ft_my_split.c \
2021-10-29 17:50:09 +02:00
ft_print.c \
ft_run_test.c \
main.c \
+ -L../libft -I../libft -lft
AND = &&
2021-10-27 11:03:34 +00:00
--- a/ft.h
+++ b/ft.h
@@ -13,15 +13,24 @@
#ifndef FT_H
# define FT_H
+#include <ctype.h>
+
//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 <malloc/malloc.h>"
//For MacOs next #include should be #include <malloc.h>
+#ifdef __GNU_LIBRARY__
+#include <malloc.h>
+#else
#include <malloc/malloc.h>
-
+#endif
//Includes
#include <stdio.h>