summaryrefslogtreecommitdiff
path: root/makeopts.in
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2015-03-12 12:40:23 +0000
committerMatthew Jordan <mjordan@digium.com>2015-03-12 12:40:23 +0000
commit29304d10a0981fddf020b0c8655d041d3f15960f (patch)
treec19ea2bdef21a8c59eed62c1a835dade974099d9 /makeopts.in
parent4115e327acc6d97d2308fcc3bbe6676b12b5907a (diff)
Add support for the clang compiler; update RAII_VAR to use BlocksRuntime
RAII_VAR, which is used extensively in Asterisk to manage reference counted resources, uses a GCC extension to automatically invoke a cleanup function when a variable loses scope. While this functionality is incredibly useful and has prevented a large number of memory leaks, it also prevents Asterisk from being compiled with clang. This patch updates the RAII_VAR macro such that it can be compiled with clang. It makes use of the BlocksRuntime, which allows for a closure to be created that performs the actual cleanup. Note that this does not attempt to address the numerous warnings that the clang compiler catches in Asterisk. Much thanks for this patch goes to: * The folks on StackOverflow who asked this question and Leushenko for providing the answer that formed the basis of this code: http://stackoverflow.com/questions/24959440/rewrite-gcc-cleanup-macro-with-nested-function-for-clang * Diederik de Groot, who has been extremely patient in working on getting this patch into Asterisk. Review: https://reviewboard.asterisk.org/r/4370/ ASTERISK-24133 ASTERISK-23666 ASTERISK-20399 ASTERISK-20850 #close Reported by: Diederik de Groot patches: RAII_CLANG.patch uploaded by Diederik de Groot (License 6600) ........ Merged revisions 432807 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 432808 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432809 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'makeopts.in')
-rw-r--r--makeopts.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/makeopts.in b/makeopts.in
index a0faaee46..96b031bdd 100644
--- a/makeopts.in
+++ b/makeopts.in
@@ -109,6 +109,8 @@ 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_CLANG_BLOCKS=@AST_CLANG_BLOCKS@
+AST_CLANG_BLOCKS_LIBS=@AST_CLANG_BLOCKS_LIBS@
AST_RPATH=@AST_RPATH@
AST_FORTIFY_SOURCE=@AST_FORTIFY_SOURCE@
AST_MARCH_NATIVE=@AST_MARCH_NATIVE@