Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global.h's g macro causes failure with protobuf-3.7.0 #3617

Closed
atsampson opened this issue Mar 1, 2019 · 1 comment · Fixed by #3623
Closed

Global.h's g macro causes failure with protobuf-3.7.0 #3617

atsampson opened this issue Mar 1, 2019 · 1 comment · Fixed by #3623
Labels
build Everything related to compiling/building the code client priority/P2 - Important

Comments

@atsampson
Copy link

I've just tried to build mumble 1.2.19 against the newly-released protobuf 3.7.0, and it fails as follows while building several source files (basically, anything that includes Mumble.pb.h indirectly after including Global.h). I'm passing -ftrack-macro-expansion=0 to g++ here so it shows where the macro is being expanded from rather than its definition.

In file included from /gar/include/google/protobuf/message_lite.h:49,
                 from /gar/include/google/protobuf/wire_format_lite_inl.h:45,
                 from /gar/include/google/protobuf/map_type_handler.h:35,
                 from /gar/include/google/protobuf/map.h:49,
                 from /gar/include/google/protobuf/generated_message_table_driven.h:34,          
                 from Mumble.pb.h:26,
                 from ServerHandler.h:57,
                 from BanEditor.cpp:38:
/gar/include/google/protobuf/stubs/strutil.h: At global scope:
/gar/include/google/protobuf/stubs/strutil.h:720:47: error: expected ',' or '.. ' before '(' token             
                               const AlphaNum& g);
                                               ^

So the problem is that Global.h has defined a macro called g, and the protobuf headers use g as an argument name. Adding #include "Mumble.pb.h" before #define g in Global.h works as a horrible workaround but I'm sure there's a better fix out there!

@davidebeatrici
Copy link
Member

Thank you very much for reporting the issue!

It is now fixed in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Everything related to compiling/building the code client priority/P2 - Important
Projects
None yet
2 participants