[asterisk-commits] dlee: branch 11 r373119 - in /branches/11: ./ include/asterisk/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Sep 18 10:47:08 CDT 2012
Author: dlee
Date: Tue Sep 18 10:47:01 2012
New Revision: 373119
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=373119
Log:
Add -fnested-functions compile flag, if needed.
In order to use nested functions on some versions of GCC (e.g. GCC on OS X),
the -fnested-functions flag must be passed to the compiler. This patch adds
detection logic to ./configure to add the flag if necessary. It also adds
a comment to utils.h as to why the nested function needs a prototype.
(closes issue ASTERISK-20399)
Reported by: David M. Lee
Review: https://reviewboard.asterisk.org/r/2102/
Modified:
branches/11/Makefile
branches/11/configure
branches/11/configure.ac
branches/11/include/asterisk/autoconfig.h.in
branches/11/include/asterisk/utils.h
branches/11/makeopts.in
Modified: branches/11/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/11/Makefile?view=diff&rev=373119&r1=373118&r2=373119
==============================================================================
--- branches/11/Makefile (original)
+++ branches/11/Makefile Tue Sep 18 10:47:01 2012
@@ -184,7 +184,7 @@
_ASTCFLAGS+=-Wall
endif
-_ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG)
+_ASTCFLAGS+=-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_NESTED_FUNCTIONS) $(DEBUG)
ADDL_TARGETS=
ifeq ($(AST_DEVMODE),yes)
Modified: branches/11/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/11/configure.ac?view=diff&rev=373119&r1=373118&r2=373119
==============================================================================
--- branches/11/configure.ac (original)
+++ branches/11/configure.ac Tue Sep 18 10:47:01 2012
@@ -1038,6 +1038,18 @@
fi
AC_SUBST(AST_NATIVE_ARCH)
+dnl Nested functions required for RAII implementation
+AC_MSG_CHECKING(for -fnested-functions)
+AC_COMPILE_IFELSE(
+ dnl Prototype needed due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36774
+ [AC_LANG_PROGRAM([], [auto void foo(void); void foo(void) {}])],
+ AC_MSG_RESULT(no)
+ [AST_NESTED_FUNCTIONS=],
+ AC_MSG_RESULT(required)
+ [AST_NESTED_FUNCTIONS=-fnested-functions]
+)
+AC_SUBST(AST_NESTED_FUNCTIONS)
+
AC_MSG_CHECKING(for sysinfo)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <sys/sysinfo.h>],
Modified: branches/11/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/branches/11/include/asterisk/autoconfig.h.in?view=diff&rev=373119&r1=373118&r2=373119
==============================================================================
--- branches/11/include/asterisk/autoconfig.h.in (original)
+++ branches/11/include/asterisk/autoconfig.h.in Tue Sep 18 10:47:01 2012
@@ -845,19 +845,19 @@
/* Define to 1 if you have the `strtoq' function. */
#undef HAVE_STRTOQ
-/* Define to 1 if `ifr_ifru.ifru_hwaddr' is member of `struct ifreq'. */
+/* Define to 1 if `ifr_ifru.ifru_hwaddr' is a member of `struct ifreq'. */
#undef HAVE_STRUCT_IFREQ_IFR_IFRU_IFRU_HWADDR
-/* Define to 1 if `uid' is member of `struct sockpeercred'. */
+/* Define to 1 if `uid' is a member of `struct sockpeercred'. */
#undef HAVE_STRUCT_SOCKPEERCRED_UID
-/* Define to 1 if `st_blksize' is member of `struct stat'. */
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
-/* Define to 1 if `cr_uid' is member of `struct ucred'. */
+/* Define to 1 if `cr_uid' is a member of `struct ucred'. */
#undef HAVE_STRUCT_UCRED_CR_UID
-/* Define to 1 if `uid' is member of `struct ucred'. */
+/* Define to 1 if `uid' is a member of `struct ucred'. */
#undef HAVE_STRUCT_UCRED_UID
/* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -1134,6 +1134,9 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
Modified: branches/11/include/asterisk/utils.h
URL: http://svnview.digium.com/svn/asterisk/branches/11/include/asterisk/utils.h?view=diff&rev=373119&r1=373118&r2=373119
==============================================================================
--- branches/11/include/asterisk/utils.h (original)
+++ branches/11/include/asterisk/utils.h Tue Sep 18 10:47:01 2012
@@ -918,8 +918,9 @@
* \encode
*/
#define RAII_VAR(vartype, varname, initval, dtor) \
+ /* Prototype needed due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36774 */ \
auto void _dtor_ ## varname (vartype * v); \
- auto void _dtor_ ## varname (vartype * v) { dtor(*v); } \
+ void _dtor_ ## varname (vartype * v) { dtor(*v); } \
vartype varname __attribute__((cleanup(_dtor_ ## varname))) = (initval)
#endif /* _ASTERISK_UTILS_H */
Modified: branches/11/makeopts.in
URL: http://svnview.digium.com/svn/asterisk/branches/11/makeopts.in?view=diff&rev=373119&r1=373118&r2=373119
==============================================================================
--- branches/11/makeopts.in (original)
+++ branches/11/makeopts.in Tue Sep 18 10:47:01 2012
@@ -105,6 +105,7 @@
AST_TRAMPOLINES=@AST_TRAMPOLINES@
AST_NO_STRICT_OVERFLOW=@AST_NO_STRICT_OVERFLOW@
AST_SHADOW_WARNINGS=@AST_SHADOW_WARNINGS@
+AST_NESTED_FUNCTIONS=@AST_NESTED_FUNCTIONS@
AST_FORTIFY_SOURCE=@AST_FORTIFY_SOURCE@
AST_MARCH_NATIVE=@AST_MARCH_NATIVE@
More information about the asterisk-commits
mailing list