aboutsummaryrefslogtreecommitdiff
path: root/ft_list_push_front.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_push_front.s
parent28424105e255f0a4c887b6e6a83afd6dce372709 (diff)
downloadlibasm-cd5c9e6a923878e797212d27476ee217eb844a14.tar.gz
libasm-cd5c9e6a923878e797212d27476ee217eb844a14.tar.bz2
libasm-cd5c9e6a923878e797212d27476ee217eb844a14.zip
Added Linux compatibility
Diffstat (limited to 'ft_list_push_front.s')
-rw-r--r--ft_list_push_front.s16
1 files changed, 12 insertions, 4 deletions
diff --git a/ft_list_push_front.s b/ft_list_push_front.s
index 6a95909..e4cfb02 100644
--- a/ft_list_push_front.s
+++ b/ft_list_push_front.s
@@ -10,12 +10,20 @@
; ;
; **************************************************************************** ;
-extern _malloc
+%ifdef __LINUX__
+ %define M_FT_LIST_PUSH_FRONT ft_list_push_front
+ %define M_MALLOC malloc
+%else
+ %define M_FT_LIST_PUSH_FRONT _ft_list_push_front
+ %define M_MALLOC _malloc
+%endif
-global _ft_list_push_front
+extern M_MALLOC
+
+global M_FT_LIST_PUSH_FRONT
; void ft_list_push_front(t_list **begin_list, void *data);
-_ft_list_push_front:
+M_FT_LIST_PUSH_FRONT:
cmp rdi, 0
je FT_LIST_PUSH_FRONT_END
@@ -23,7 +31,7 @@ _ft_list_push_front:
push rsi
xor rdi, rdi
mov edi, 16
- call _malloc
+ call M_MALLOC wrt ..plt
pop rsi
pop rdi
cmp rax, 0