From 7d799523e5fd7d396e0b4596e345c35b544a07c6 Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Tue, 30 Jan 2007 21:26:08 +0000 Subject: [PATCH] - include the attributes for always_inline and sentinel This commit was SVN r13373. --- config/ompi_check_attributes.m4 | 30 ++++++++++++++++++++++++++++++ opal/include/opal_config_bottom.h | 8 ++++++++ 2 files changed, 38 insertions(+) diff --git a/config/ompi_check_attributes.m4 b/config/ompi_check_attributes.m4 index 39d5260e27..d1079bcf13 100644 --- a/config/ompi_check_attributes.m4 +++ b/config/ompi_check_attributes.m4 @@ -42,6 +42,7 @@ AC_DEFUN([OMPI_CHECK____ATTRIBUTE__], [ # if test "$ac_cv___attribute__msg" = "no"; then ac_cv___attribute__aligned=0 + ac_cv___attribute__always_inline=0 ac_cv___attribute__const=0 ac_cv___attribute__deprecated=0 ac_cv___attribute__format=0 @@ -51,6 +52,7 @@ AC_DEFUN([OMPI_CHECK____ATTRIBUTE__], [ ac_cv___attribute__pure=0 ac_cv___attribute__packed=0 ac_cv___attribute__unused=0 + ac_cv___attribute__sentinel=0 ac_cv___attribute__visibility=0 ac_cv___attribute__warn_unused_result=0 ac_cv___attribute__weak_alias=0 @@ -68,6 +70,18 @@ AC_DEFUN([OMPI_CHECK____ATTRIBUTE__], [ AC_MSG_RESULT($ac_cv___attribute__aligned_msg) + AC_MSG_CHECKING([for __attribute__ ((always_inline))]) + AC_CACHE_VAL(ac_cv___attribute__always_inline, [ + AC_TRY_COMPILE( + [#include + int foo (int arg) __attribute__ ((always_inline));], + [], + [ac_cv___attribute__always_inline=1 ac_cv___attribute__always_inline_msg=yes], + [ac_cv___attribute__always_inline=0 ac_cv___attribute__always_inline_msg=no] + )]) + AC_MSG_RESULT($ac_cv___attribute__always_inline_msg) + + AC_MSG_CHECKING([for __attribute__ ((const))]) AC_CACHE_VAL(ac_cv___attribute__const, [ AC_TRY_COMPILE( @@ -188,6 +202,18 @@ AC_DEFUN([OMPI_CHECK____ATTRIBUTE__], [ AC_MSG_RESULT($ac_cv___attribute__pure_msg) + AC_MSG_CHECKING([for __attribute__ ((sentinel))]) + AC_CACHE_VAL(ac_cv___attribute__sentinel, [ + AC_TRY_COMPILE( + [#include + int my_execlp(const char * file, const char *arg, ...) __attribute__ ((sentinel));], + [], + [ac_cv___attribute__sentinel=1 ac_cv___attribute__sentinel_msg=yes], + [ac_cv___attribute__sentinel=0 ac_cv___attribute__sentinel_msg=no] + )]) + AC_MSG_RESULT($ac_cv___attribute__sentinel_msg) + + AC_MSG_CHECKING([for __attribute__ ((unused))]) AC_CACHE_VAL(ac_cv___attribute__unused, [ AC_TRY_COMPILE( @@ -245,6 +271,8 @@ AC_DEFUN([OMPI_CHECK____ATTRIBUTE__], [ AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_ALIGNED, [$ac_cv___attribute__aligned], [Whether your compiler has __attribute__ aligned or not]) + AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_ALWAYS_INLINE, [$ac_cv___attribute__always_inline], + [Whether your compiler has __attribute__ always_inline or not]) AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_CONST, [$ac_cv___attribute__const], [Whether your compiler has __attribute__ const or not]) AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_DEPRECATED, [$ac_cv___attribute__deprecated], @@ -263,6 +291,8 @@ AC_DEFUN([OMPI_CHECK____ATTRIBUTE__], [ [Whether your compiler has __attribute__ packed or not]) AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_PURE, [$ac_cv___attribute__pure], [Whether your compiler has __attribute__ pure or not]) + AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_SENTINEL, [$ac_cv___attribute__sentinel], + [Whether your compiler has __attribute__ sentinel or not]) AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_UNUSED, [$ac_cv___attribute__unused], [Whether your compiler has __attribute__ unused or not]) AC_DEFINE_UNQUOTED(OMPI_HAVE_ATTRIBUTE_VISIBILITY, [$ac_cv___attribute__visibility], diff --git a/opal/include/opal_config_bottom.h b/opal/include/opal_config_bottom.h index 6ff1164743..c9af38cd4d 100644 --- a/opal/include/opal_config_bottom.h +++ b/opal/include/opal_config_bottom.h @@ -363,6 +363,10 @@ static inline uint16_t ntohs(uint16_t netvar) { return netvar; } # define __opal_attribute_aligned_max__ __attribute__((__aligned__)) # endif +# if OMPI_HAVE_ATTRIBUTE_ALWAYS_INLINE +# define __opal_attribute_always_inline__ __attribute__((__always_inline__)) +# endif + # if OMPI_HAVE_ATTRIBUTE_CONST # define __opal_attribute_const__ __attribute__((__const__)) # endif @@ -399,6 +403,10 @@ static inline uint16_t ntohs(uint16_t netvar) { return netvar; } # define __opal_attribute_pure__ __attribute__((__pure__)) # endif +# if OMPI_HAVE_ATTRIBUTE_SENTINEL +# define __opal_attribute_sentinel__ __attribute__((__sentinel__)) +# endif + # if OMPI_HAVE_ATTRIBUTE_UNUSED # define __opal_attribute_unused__ __attribute__((__unused__)) # endif