From cd5c9e6a923878e797212d27476ee217eb844a14 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 11 Feb 2021 15:40:48 +0100 Subject: Added Linux compatibility --- ft_list_sort.s | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'ft_list_sort.s') diff --git a/ft_list_sort.s b/ft_list_sort.s index a541bd8..b4899ef 100644 --- a/ft_list_sort.s +++ b/ft_list_sort.s @@ -10,12 +10,18 @@ ; ; ; **************************************************************************** ; -global _ft_list_sort +%ifdef __LINUX__ + %define M_FT_LIST_SORT ft_list_sort +%else + %define M_FT_LIST_SORT _ft_list_sort +%endif + +global M_FT_LIST_SORT %define NULL 0x0 ; void ft_list_sort(t_list **begin_list, int (*cmp)(void*, void*)); -_ft_list_sort: +M_FT_LIST_SORT: ; t_list *slow : rax = *begin_list ; t_list *fast : rbx = (*begin_list)->next ; t_list *middle : rsp + 0 @@ -54,9 +60,9 @@ FT_LIST_SORT_MIDDLE_LOOP_END: ; === sorting both child list === push rdi push rsi - call _ft_list_sort ; ft_list_sort(begin_list, cmp) + call M_FT_LIST_SORT ; ft_list_sort(begin_list, cmp) lea rdi, [rbp - 8] - call _ft_list_sort ; ft_list_sort(&middle, cmp) + call M_FT_LIST_SORT ; ft_list_sort(&middle, cmp) pop rsi pop rdi -- cgit