… | |
… | |
23 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
23 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
24 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
24 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH- |
25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTH- |
26 | * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
26 | * ERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
27 | * OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | * OF THE POSSIBILITY OF SUCH DAMAGE. |
|
|
28 | * |
|
|
29 | * Alternatively, the contents of this file may be used under the terms of |
|
|
30 | * the GNU General Public License ("GPL") version 2 or any later version, |
|
|
31 | * in which case the provisions of the GPL are applicable instead of |
|
|
32 | * the above. If you wish to allow the use of your version of this file |
|
|
33 | * only under the terms of the GPL and not to allow others to use your |
|
|
34 | * version of this file under the BSD license, indicate your decision |
|
|
35 | * by deleting the provisions above and replace them with the notice |
|
|
36 | * and other provisions required by the GPL. If you do not delete the |
|
|
37 | * provisions above, a recipient may use your version of this file under |
|
|
38 | * either the BSD or the GPL. |
28 | */ |
39 | */ |
29 | |
40 | |
30 | #ifndef ECB_H |
41 | #ifndef ECB_H |
31 | #define ECB_H |
42 | #define ECB_H |
32 | |
43 | |
… | |
… | |
79 | * causing enormous grief in return for some better fake benchmark numbers. |
90 | * causing enormous grief in return for some better fake benchmark numbers. |
80 | * or so. |
91 | * or so. |
81 | * we try to detect these and simply assume they are not gcc - if they have |
92 | * we try to detect these and simply assume they are not gcc - if they have |
82 | * an issue with that they should have done it right in the first place. |
93 | * an issue with that they should have done it right in the first place. |
83 | */ |
94 | */ |
84 | #ifndef ECB_GCC_VERSION |
|
|
85 | #if !defined __GNUC_MINOR__ || defined __INTEL_COMPILER || defined __SUNPRO_C || defined __SUNPRO_CC || defined __llvm__ || defined __clang__ |
95 | #if !defined __GNUC_MINOR__ || defined __INTEL_COMPILER || defined __SUNPRO_C || defined __SUNPRO_CC || defined __llvm__ || defined __clang__ |
86 | #define ECB_GCC_VERSION(major,minor) 0 |
96 | #define ECB_GCC_VERSION(major,minor) 0 |
87 | #else |
97 | #else |
88 | #define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) |
98 | #define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) |
89 | #endif |
|
|
90 | #endif |
99 | #endif |
91 | |
100 | |
92 | #define ECB_CPP (__cplusplus+0) |
101 | #define ECB_CPP (__cplusplus+0) |
93 | #define ECB_CPP11 (__cplusplus >= 201103L) |
102 | #define ECB_CPP11 (__cplusplus >= 201103L) |
94 | |
103 | |
… | |
… | |
311 | #define ecb_decltype(x) __decltype(x) |
320 | #define ecb_decltype(x) __decltype(x) |
312 | #elif ECB_GCC_VERSION(3,0) |
321 | #elif ECB_GCC_VERSION(3,0) |
313 | #define ecb_decltype(x) __typeof(x) |
322 | #define ecb_decltype(x) __typeof(x) |
314 | #endif |
323 | #endif |
315 | |
324 | |
|
|
325 | #if _MSC_VER >= 1300 |
|
|
326 | #define ecb_deprecated __declspec(deprecated) |
|
|
327 | #else |
|
|
328 | #define ecb_deprecated ecb_attribute ((__deprecated__)) |
|
|
329 | #endif |
|
|
330 | |
316 | #define ecb_noinline ecb_attribute ((__noinline__)) |
331 | #define ecb_noinline ecb_attribute ((__noinline__)) |
317 | #define ecb_unused ecb_attribute ((__unused__)) |
332 | #define ecb_unused ecb_attribute ((__unused__)) |
318 | #define ecb_const ecb_attribute ((__const__)) |
333 | #define ecb_const ecb_attribute ((__const__)) |
319 | #define ecb_pure ecb_attribute ((__pure__)) |
334 | #define ecb_pure ecb_attribute ((__pure__)) |
320 | |
335 | |
|
|
336 | /* http://msdn.microsoft.com/en-us/library/k6ktzx3s.aspx __declspec(noreturn) */ |
321 | #if ECB_C11 |
337 | #if ECB_C11 |
322 | #define ecb_noreturn _Noreturn |
338 | #define ecb_noreturn _Noreturn |
323 | #else |
339 | #else |
324 | #define ecb_noreturn ecb_attribute ((__noreturn__)) |
340 | #define ecb_noreturn ecb_attribute ((__noreturn__)) |
325 | #endif |
341 | #endif |
… | |
… | |
594 | /* the only noteworthy exception is ancient armle, which uses order 43218765 */ |
610 | /* the only noteworthy exception is ancient armle, which uses order 43218765 */ |
595 | #if 0 \ |
611 | #if 0 \ |
596 | || __i386 || __i386__ \ |
612 | || __i386 || __i386__ \ |
597 | || __amd64 || __amd64__ || __x86_64 || __x86_64__ \ |
613 | || __amd64 || __amd64__ || __x86_64 || __x86_64__ \ |
598 | || __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__ \ |
614 | || __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__ \ |
599 | || defined __arm__ && defined __ARM_EABI__ \ |
|
|
600 | || defined __s390__ || defined __s390x__ \ |
615 | || defined __s390__ || defined __s390x__ \ |
601 | || defined __mips__ \ |
616 | || defined __mips__ \ |
602 | || defined __alpha__ \ |
617 | || defined __alpha__ \ |
603 | || defined __hppa__ \ |
618 | || defined __hppa__ \ |
604 | || defined __ia64__ \ |
619 | || defined __ia64__ \ |
605 | || defined __m68k__ \ |
620 | || defined __m68k__ \ |
606 | || defined __m88k__ \ |
621 | || defined __m88k__ \ |
607 | || defined __sh__ \ |
622 | || defined __sh__ \ |
608 | || defined _M_IX86 || defined _M_AMD64 || defined _M_IA64 |
623 | || defined _M_IX86 || defined _M_AMD64 || defined _M_IA64 \ |
|
|
624 | || (defined __arm__ && (defined __ARM_EABI__ || defined __EABI__ || defined __VFP_FP__ || defined _WIN32_WCE || defined __ANDROID__)) \ |
|
|
625 | || defined __aarch64__ |
609 | #define ECB_STDFP 1 |
626 | #define ECB_STDFP 1 |
610 | #include <string.h> /* for memcpy */ |
627 | #include <string.h> /* for memcpy */ |
611 | #else |
628 | #else |
612 | #define ECB_STDFP 0 |
629 | #define ECB_STDFP 0 |
613 | #endif |
630 | #endif |