work around gcc issues with nested macros and pragmas

close #389