Expected use of PROTOBUF_NAMESPACE* macros?

51 views
Skip to first unread message

Keith Smiley

unread,
Apr 30, 2020, 7:40:01 PM4/30/20
to Protocol Buffers
We've recently started hitting an issue in our iOS app where we have multiple transitive dependencies that depend on different versions of protobuf that are vendored differently depending on the library. In order to overcome this we were hoping to be able to compile protobuf in such a way that its symbols were different for different dependencies, thus namespacing the duplicate symbol issue away.

We have noticed that Google does this with the GoogleMaps SDK, changing the namespace from google::protobuf to GMSx_google::protobuf_opensource and we were hoping we could do something similar. It appears that these macros are designed to do this, with the small problem that there are quite a few places in code where they are not used, and their current values are hardcoded.

Is this behavior the intention of these macros? In which case would a change be accepted that replaced all the hardcoded namespaces with these macros? Otherwise is there another way we can do this?

Thanks!

Keith Smiley

unread,
May 6, 2020, 4:31:38 PM5/6/20
to Protocol Buffers
I've submitted this PR for discussion https://github.com/protocolbuffers/protobuf/pull/7472
Reply all
Reply to author
Forward
0 new messages