aboutsummaryrefslogtreecommitdiff
path: root/ft_list_sort.s
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-02-11 15:40:48 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-02-11 15:40:48 +0100
commitcd5c9e6a923878e797212d27476ee217eb844a14 (patch)
treef5ea8605d0521cbfbf384b05567bf3d2155b0b45 /ft_list_sort.s
parent28424105e255f0a4c887b6e6a83afd6dce372709 (diff)
downloadlibasm-cd5c9e6a923878e797212d27476ee217eb844a14.tar.gz
libasm-cd5c9e6a923878e797212d27476ee217eb844a14.tar.bz2
libasm-cd5c9e6a923878e797212d27476ee217eb844a14.zip
Added Linux compatibility
Diffstat (limited to 'ft_list_sort.s')
-rw-r--r--ft_list_sort.s14
1 files changed, 10 insertions, 4 deletions
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