diff --git a/libco.h b/libco.h index 792df0bd..0ea47789 100644 --- a/libco.h +++ b/libco.h @@ -1,5 +1,5 @@ /* - libco v18 (2016-09-14) + libco v18.01 (2017-01-22) author: byuu license: public domain */ diff --git a/settings.h b/settings.h index b419683a..d8037bc4 100644 --- a/settings.h +++ b/settings.h @@ -1,4 +1,4 @@ -#ifdef LIBCO_C +#if defined(LIBCO_C) /*[amd64, arm, ppc, x86]: by default, co_swap_function is marked as a text (code) section @@ -10,8 +10,8 @@ do not use this unless you are certain your application won't use SSE */ /* #define LIBCO_NO_SSE */ -#ifdef LIBCO_C - #ifdef LIBCO_MP +#if defined(LIBCO_C) + #if defined(LIBCO_MP) #define thread_local __thread #else #define thread_local @@ -19,18 +19,20 @@ #endif #if __STDC_VERSION__ >= 201112L - #ifndef _MSC_VER + #if !defined(_MSC_VER) #include #endif #else #define alignas(bytes) #endif -#ifndef _MSC_VER - #define section(name) __attribute__((section("." #name "#"))) -#else +#if defined(_MSC_VER) #define section(name) __declspec(allocate("." #name)) +#elif defined(__APPLE__) + #define section(name) __attribute__((section("__TEXT,__" #name))) +#else + #define section(name) __attribute__((section("." #name "#"))) #endif -/* ifdef LIBCO_C */ +/* if defined(LIBCO_C) */ #endif