diff --git a/lib/cmock_config.rb b/lib/cmock_config.rb index 716a0c5..c7db945 100644 --- a/lib/cmock_config.rb +++ b/lib/cmock_config.rb @@ -15,7 +15,7 @@ class CMockConfig :weak => '', :subdir => nil, :plugins => [], - :strippables => ['(?:__attribute__\s*\(+.*?\)+)'], + :strippables => ['(?:__attribute__\s*\([ (]*.*?[ )]*\)+)'], :attributes => %w[__ramfunc __irq __fiq register extern], :c_calling_conventions => %w[__stdcall __cdecl __fastcall], :enforce_strict_ordering => false, @@ -50,7 +50,7 @@ class CMockConfig # - The keywords can appear before or after the return type (this is a compiler warning but people do weird stuff), # so we check for word boundaries when searching for them # - We first remove "static inline" combinations and boil down to single inline or static statements - :inline_function_patterns => ['(static\s+inline|inline\s+static)\s*', '(\bstatic\b|\binline\b)\s*'] # Last part (\s*) is just to remove whitespaces (only to prettify the output) + :inline_function_patterns => ['(static\s+inline|inline\s+static)\s*', '(\bstatic\b|\binline\b)\s*', '(?:static\s*)?(?:__inline__)?__attribute__\s*\([ (]*always_inline[ )]*\)', 'static __inline__'] # Last part (\s*) is just to remove whitespaces (only to prettify the output) }.freeze def initialize(options = nil) diff --git a/lib/cmock_generator.rb b/lib/cmock_generator.rb index 826bf8b..c3896df 100644 --- a/lib/cmock_generator.rb +++ b/lib/cmock_generator.rb @@ -22,7 +22,7 @@ class CMockGenerator @exclude_setjmp_h = @config.exclude_setjmp_h @subdir = @config.subdir - @includes_h_pre_orig_header = (@config.includes || @config.includes_h_pre_orig_header || []).map { |h| h =~ /