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_push_front.s | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'ft_list_push_front.s') 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 -- cgit