From fda08b3a2eeb39f24757d2549f790f105f1dd3b8 Mon Sep 17 00:00:00 2001 From: eschnett Date: Tue, 15 Jan 2013 17:27:08 +0000 Subject: Autoconf attribute always_inline Add autoconf test for __attribute__((__always_inline__)). Improve autoconf test for _Pragma syntax. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4934 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/make/cctk_Config.h.in | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'lib/make/cctk_Config.h.in') diff --git a/lib/make/cctk_Config.h.in b/lib/make/cctk_Config.h.in index 20e6109a..3325828f 100644 --- a/lib/make/cctk_Config.h.in +++ b/lib/make/cctk_Config.h.in @@ -200,6 +200,12 @@ # define CCTK_RESTRICT restrict #endif +/* Disable _Pragma if unsupported */ +#undef HAVE_CCTK_C__PRAGMA +#ifndef HAVE_CCTK_C__PRAGMA +# define _Pragma(x) +#endif + /* Some C compilers (e.g. C99 ones) define bool */ #undef HAVE_CCTK_C_BOOL @@ -208,8 +214,6 @@ # define CCTK_HAVE_C_BOOL #endif -#undef HAVE_CCTK_C__PRAGMA - /* Since this is non-standard leave commented out for the moment */ #if 0 #ifndef HAVE_CCTK_C_BOOL @@ -297,6 +301,14 @@ typedef enum {false, true} bool; # define CCTK_ATTRIBUTE_NOINLINE #endif +/* Whether __attribute__((always_inline)) exists. */ +#undef HAVE_CCTK_C_ATTRIBUTE_ALWAYS_INLINE +#ifdef HAVE_CCTK_C_ATTRIBUTE_ALWAYS_INLINE +# define CCTK_ATTRIBUTE_ALWAYS_INLINE __attribute__((__always_inline__)) +#else +# define CCTK_ATTRIBUTE_ALWAYS_INLINE +#endif + /* Whether __attribute__((unused)) exists. */ #undef HAVE_CCTK_C_ATTRIBUTE_UNUSED #ifdef HAVE_CCTK_C_ATTRIBUTE_UNUSED @@ -463,6 +475,20 @@ typedef enum {false, true} bool; # define CCTK_MEMBER_ATTRIBUTE_NOINLINE #endif +/* Whether __attribute__((always_inline)) exists. */ +#undef HAVE_CCTK_CXX_ATTRIBUTE_ALWAYS_INLINE +#ifdef HAVE_CCTK_CXX_ATTRIBUTE_ALWAYS_INLINE +# define CCTK_ATTRIBUTE_ALWAYS_INLINE __attribute__((__always_inline__)) +#else +# define CCTK_ATTRIBUTE_ALWAYS_INLINE +#endif +#undef HAVE_CCTK_CXX_MEMBER_ATTRIBUTE_ALWAYS_INLINE +#ifdef HAVE_CCTK_CXX_MEMBER_ATTRIBUTE_ALWAYS_INLINE +# define CCTK_MEMBER_ATTRIBUTE_ALWAYS_INLINE __attribute__((__always_inline__)) +#else +# define CCTK_MEMBER_ATTRIBUTE_ALWAYS_INLINE +#endif + /* Whether __attribute__((unused)) exists. */ #undef HAVE_CCTK_CXX_ATTRIBUTE_UNUSED #ifdef HAVE_CCTK_CXX_ATTRIBUTE_UNUSED -- cgit v1.2.3