KEMBAR78
BACKENDS: ENET: Fix GCC/MinGW warning by orgads · Pull Request #4894 · scummvm/scummvm · GitHub
Skip to content

Conversation

@orgads
Copy link
Contributor

@orgads orgads commented Apr 9, 2023

packet.cpp:121:9: warning: declaration of 'byte' shadows a global declaration [-Wshadow]
  121 |     int byte;
      |         ^~~~
In file included from C:/msys64/mingw64/include/wtypes.h:8,
                 from C:/msys64/mingw64/include/winscard.h:10,
                 from C:/msys64/mingw64/include/windows.h:97,
                 from C:/msys64/mingw64/include/winsock2.h:23,
                 from C:/Projects/scummvm/backends/networking/enet/source/win32.h:18,
                 from C:/Projects/scummvm/backends/networking/enet/source/enet.h:16,
                 from C:/Projects/scummvm/backends/networking/enet/source/packet.cpp:7:
C:/msys64/mingw64/include/rpcndr.h:63:25: note: shadowed declaration is here
   63 |   typedef unsigned char byte;
      |                         ^~~~

Fix by defining WIN32_LEAN_AND_MEAN, which prevents this typedef.

packet.cpp:121:9: warning: declaration of 'byte' shadows a global declaration [-Wshadow]
  121 |     int byte;
      |         ^~~~
In file included from C:/msys64/mingw64/include/wtypes.h:8,
                 from C:/msys64/mingw64/include/winscard.h:10,
                 from C:/msys64/mingw64/include/windows.h:97,
                 from C:/msys64/mingw64/include/winsock2.h:23,
                 from C:/Projects/scummvm/backends/networking/enet/source/win32.h:18,
                 from C:/Projects/scummvm/backends/networking/enet/source/enet.h:16,
                 from C:/Projects/scummvm/backends/networking/enet/source/packet.cpp:7:
C:/msys64/mingw64/include/rpcndr.h:63:25: note: shadowed declaration is here
   63 |   typedef unsigned char byte;
      |                         ^~~~

Fix by defining WIN32_LEAN_AND_MEAN, which prevents this typedef.
@orgads orgads requested a review from LittleToonCat April 9, 2023 20:57
Copy link
Contributor

@LittleToonCat LittleToonCat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LittleToonCat LittleToonCat merged commit b725686 into scummvm:master Apr 9, 2023
@orgads orgads deleted the enet-lean branch April 10, 2023 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants