diff --git a/libco/amd64.c b/libco/amd64.c index 4db50c4..9beae53 100644 --- a/libco/amd64.c +++ b/libco/amd64.c @@ -38,15 +38,11 @@ static thread_local cothread_t co_active_handle = 0; 0x0F, 0x29, 0xB9, 0x90, 0x00, 0x00, 0x00, 0xFF, 0xE0, }; #else -#ifndef __APPLE__ -#define TYPE_DECL ".type co_swap, @function\n" -#else -#define TYPE_DECL -#endif asm ( ".text\n" ".globl co_swap\n" - TYPE_DECL + ".globl _co_swap\n" + "_co_swap:\n" "co_swap:\n" "movq %rsp, (%rsi) # Save stack pointer, and pop the old one back.\n" "movq (%rdi), %rsp\n" diff --git a/libco/x86.c b/libco/x86.c index 57dbeba..e9de521 100644 --- a/libco/x86.c +++ b/libco/x86.c @@ -34,7 +34,8 @@ void fastcall co_swap(cothread_t new_thread, cothread_t old_thread); #else #define ASM_CO_SWAP_DEF \ ".globl co_swap\n" \ - ".type co_swap, @function\n" \ + ".globl _co_swap\n" \ + "_co_swap:\n" \ "co_swap:\n" #endif