diff options
Diffstat (limited to 'cpp/src/slice2objc/Gen.cpp')
-rw-r--r-- | cpp/src/slice2objc/Gen.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cpp/src/slice2objc/Gen.cpp b/cpp/src/slice2objc/Gen.cpp index 4dcd484ba63..866f0e5d2db 100644 --- a/cpp/src/slice2objc/Gen.cpp +++ b/cpp/src/slice2objc/Gen.cpp @@ -759,8 +759,6 @@ Slice::Gen::generate(const UnitPtr& p) // Necessary for objc_getClass use when marshalling/unmarshalling proxies. _M << nl << "#import <objc/runtime.h>"; - _M << nl; - StringList includes = p->includeFiles(); for(StringList::const_iterator q = includes.begin(); q != includes.end(); ++q) { @@ -787,7 +785,6 @@ Slice::Gen::generate(const UnitPtr& p) _M << nl << "#ifndef " << _dllExport << "_EXPORTS"; _M << nl << "# define " << _dllExport << "_EXPORTS"; _M << nl << "#endif"; - _M << nl; _H << nl; _H << nl << "#ifndef " << _dllExport; @@ -806,6 +803,15 @@ Slice::Gen::generate(const UnitPtr& p) _dllExport += " "; } + // + // Disable shadow warnings in .cppm file + // + _M << sp; + _M.zeroIndent(); + _M << nl << "#ifdef __clang__"; + _M << nl << "# pragma clang diagnostic ignored \"-Wshadow-ivar\""; + _M << nl << "#endif"; + UnitVisitor unitVisitor(_H, _M, _dllExport); p->visit(&unitVisitor, false); |