--- libecb/ecb.h 2014/10/17 10:56:48 1.143 +++ libecb/ecb.h 2014/10/17 12:25:01 1.147 @@ -100,14 +100,14 @@ #define ECB_CLANG_VERSION(major,minor) (__clang_major__ > (major) || (__clang_major__ == (major) && __clang_minor__ >= (minor))) -#if __clang__ && defined(__has_builtin) - #define ECB_CLANG_BUILTIN(x) __has_builtin(x) +#if __clang__ && defined __has_builtin + #define ECB_CLANG_BUILTIN(x) __has_builtin (x) #else #define ECB_CLANG_BUILTIN(x) 0 #endif -#if __clang__ && defined(__has_extension) - #define ECB_CLANG_EXTENSION(x) __has_extension(x) +#if __clang__ && defined __has_extension + #define ECB_CLANG_EXTENSION(x) __has_extension (x) #else #define ECB_CLANG_EXTENSION(x) 0 #endif @@ -337,7 +337,9 @@ /* no emulation for ecb_decltype */ #if ECB_CPP11 - #define ecb_decltype(x) decltype (x) + // older implementations might have problems with decltype(x)::type, work around it + template struct ecb_decltype_t { typedef T type; }; + #define ecb_decltype(x) ecb_decltype_t::type #elif ECB_GCC_VERSION(3,0) || ECB_CLANG_VERSION(2,8) #define ecb_decltype(x) __typeof__ (x) #endif @@ -353,8 +355,9 @@ #define ecb_const ecb_attribute ((__const__)) #define ecb_pure ecb_attribute ((__pure__)) -/* http://msdn.microsoft.com/en-us/library/k6ktzx3s.aspx __declspec(noreturn) */ -#if ECB_C11 +/* TODO http://msdn.microsoft.com/en-us/library/k6ktzx3s.aspx __declspec(noreturn) */ +#if ECB_C11 || __IBMC_NORETURN + /* http://pic.dhe.ibm.com/infocenter/compbg/v121v141/topic/com.ibm.xlcpp121.bg.doc/language_ref/noreturn.html */ #define ecb_noreturn _Noreturn #else #define ecb_noreturn ecb_attribute ((__noreturn__))