diff --git a/configure b/configure index b49d8cff3374e6d4eee53d3c537e7d5478091fa6..b0dcbe66d1f58953b98d1bd73befa3e1cac7b8a3 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 114713 . +# From configure.ac Revision: 115078 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for asterisk 1.6. # @@ -16863,6 +16863,58 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: checking for compiler 'attribute sentinel' support" >&5 +echo $ECHO_N "checking for compiler 'attribute sentinel' support... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +static int __attribute__((sentinel)) test(void) {} +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAVE_ATTRIBUTE_sentinel 1 +_ACEOF + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + { echo "$as_me:$LINENO: checking for -ffunction-sections support" >&5 echo $ECHO_N "checking for -ffunction-sections support... $ECHO_C" >&6; } saved_CFLAGS="${CFLAGS}" diff --git a/configure.ac b/configure.ac index e49d3531d3e320e4e7d12948fb515c7251714896..6dbd99b473efecd4c78cfd7ceccc4fc5a9283d8f 100644 --- a/configure.ac +++ b/configure.ac @@ -437,6 +437,7 @@ AST_GCC_ATTRIBUTE(const) AST_GCC_ATTRIBUTE(unused) AST_GCC_ATTRIBUTE(always_inline) AST_GCC_ATTRIBUTE(deprecated) +AST_GCC_ATTRIBUTE(sentinel) AC_MSG_CHECKING(for -ffunction-sections support) saved_CFLAGS="${CFLAGS}" diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in index 087a6a0b2fe7c38cd5529be4d8b2c47d7e826650..d4806a5e27249bbeb5b934b8381f9741f172ced2 100644 --- a/include/asterisk/autoconfig.h.in +++ b/include/asterisk/autoconfig.h.in @@ -104,6 +104,9 @@ /* Define to 1 if your GCC C compiler supports the 'pure' attribute. */ #undef HAVE_ATTRIBUTE_pure +/* Define to 1 if your GCC C compiler supports the 'sentinel' attribute. */ +#undef HAVE_ATTRIBUTE_sentinel + /* Define to 1 if your GCC C compiler supports the 'unused' attribute. */ #undef HAVE_ATTRIBUTE_unused diff --git a/include/asterisk/compiler.h b/include/asterisk/compiler.h index 8ac441463c941abcb3ec755006344a563aeb687e..0eb3c0afdd25e32f33a54d25c20daa95730cbd10 100644 --- a/include/asterisk/compiler.h +++ b/include/asterisk/compiler.h @@ -53,4 +53,10 @@ #define attribute_malloc #endif +#if HAVE_ATTRIBUTE_sentinel +#define attribute_sentinel __attribute__((sentinel)) +#else +#define attribute_sentinel +#endif + #endif /* _ASTERISK_COMPILER_H */ diff --git a/include/asterisk/config.h b/include/asterisk/config.h index 0129af456722785e849564ec0d54a52837f999fc..80f651d44012bd2d65cdaa171b4fdc90827d4501 100644 --- a/include/asterisk/config.h +++ b/include/asterisk/config.h @@ -182,8 +182,8 @@ int ast_category_exist(const struct ast_config *config, const char *category_nam * that unlike the variables in ast_config, the resulting list of variables * MUST be freed with ast_variables_destroy() as there is no container. */ -struct ast_variable *ast_load_realtime(const char *family, ...) __attribute__((sentinel)); -struct ast_variable *ast_load_realtime_all(const char *family, ...) __attribute__((sentinel)); +struct ast_variable *ast_load_realtime(const char *family, ...) attribute_sentinel; +struct ast_variable *ast_load_realtime_all(const char *family, ...) attribute_sentinel; /*! * \brief Retrieve realtime configuration @@ -194,7 +194,7 @@ struct ast_variable *ast_load_realtime_all(const char *family, ...) __attribute_ * is thus stored inside a taditional ast_config structure rather than * just returning a linked list of variables. */ -struct ast_config *ast_load_realtime_multientry(const char *family, ...) __attribute__((sentinel)); +struct ast_config *ast_load_realtime_multientry(const char *family, ...) attribute_sentinel; /*! * \brief Update realtime configuration @@ -204,7 +204,7 @@ struct ast_config *ast_load_realtime_multientry(const char *family, ...) __attri * This function is used to update a parameter in realtime configuration space. * */ -int ast_update_realtime(const char *family, const char *keyfield, const char *lookup, ...) __attribute__((sentinel)); +int ast_update_realtime(const char *family, const char *keyfield, const char *lookup, ...) attribute_sentinel; /*! * \brief Create realtime configuration @@ -212,7 +212,7 @@ int ast_update_realtime(const char *family, const char *keyfield, const char *lo * This function is used to create a parameter in realtime configuration space. * */ -int ast_store_realtime(const char *family, ...) __attribute__((sentinel)); +int ast_store_realtime(const char *family, ...) attribute_sentinel; /*! * \brief Destroy realtime configuration @@ -223,7 +223,7 @@ int ast_store_realtime(const char *family, ...) __attribute__((sentinel)); * Additional params are used as keys. * */ -int ast_destroy_realtime(const char *family, const char *keyfield, const char *lookup, ...) __attribute__((sentinel)); +int ast_destroy_realtime(const char *family, const char *keyfield, const char *lookup, ...) attribute_sentinel; /*! * \brief Check if realtime engine is configured for family