diff options
author | Davide Beatrici <davidebeatrici@gmail.com> | 2019-03-05 02:44:52 +0300 |
---|---|---|
committer | Davide Beatrici <davidebeatrici@gmail.com> | 2019-03-05 02:44:52 +0300 |
commit | ce0ecff200dd6e57a13c67b189406318595b52fb (patch) | |
tree | ed29ad71e1e8669bdf091166df321aba1a65e22d /src/mumble/WASAPI.cpp | |
parent | 03258363dfcc6fa9f741ced5b823ef6a50e6eca3 (diff) |
Include "Global.h" after "Mumble.pb.h", to avoid a redefinition issue with protobuf 3.7
In protobuf 3.7 'g' is used as argument name, which conflicts with our global struct:
google/protobuf/stubs/strutil.h:720:47: error: 'g_global_struct' declared as a pointer to a reference of type 'const google::protobuf::strings::AlphaNum &'
const AlphaNum& g);
^
./Global.h:131:12: note: expanded from macro 'g'
^
The solution consists in including "Global.h" after any headers that include "Mumble.pb.h" (which in turn includes protobuf's headers).
"Mumble.pb.h" is generated by protobuf.
Diffstat (limited to 'src/mumble/WASAPI.cpp')
-rw-r--r-- | src/mumble/WASAPI.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mumble/WASAPI.cpp b/src/mumble/WASAPI.cpp index 8e66410b7..16d16691a 100644 --- a/src/mumble/WASAPI.cpp +++ b/src/mumble/WASAPI.cpp @@ -8,9 +8,11 @@ #include "WASAPI.h" #include "WASAPINotificationClient.h" -#include "Global.h" #include "MainWindow.h" +// We define a global macro called 'g'. This can lead to issues when included code uses 'g' as a type or parameter name (like protobuf 3.7 does). As such, for now, we have to make this our last include. +#include "Global.h" + // Now that Win7 is published, which includes public versions of these // interfaces, we simply inherit from those but use the "old" IIDs. |