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

weapon.c:503:40: error: ‘USHRT_MAX’ undeclared #38

Closed
Eonfge opened this issue Sep 15, 2023 · 5 comments
Closed

weapon.c:503:40: error: ‘USHRT_MAX’ undeclared #38

Eonfge opened this issue Sep 15, 2023 · 5 comments

Comments

@Eonfge
Copy link

Eonfge commented Sep 15, 2023

[13/62] Building C object CMakeFiles/game.dir/src/player/weapon.c.o
FAILED: CMakeFiles/game.dir/src/player/weapon.c.o 
/usr/bin/cc -DYQ2ARCH=\"x86_64\" -DYQ2OSTYPE=\"Linux\" -Dgame_EXPORTS  -O2 -pipe -g -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -Wall -fno-strict-aliasing -fwrapv -O2 -g -DNDEBUG -fPIC -MD -MT CMakeFiles/game.dir/src/player/weapon.c.o -MF CMakeFiles/game.dir/src/player/weapon.c.o.d -o CMakeFiles/game.dir/src/player/weapon.c.o -c /run/build/zaero/src/player/weapon.c
/run/build/zaero/src/player/weapon.c: In function ‘Weapon_Generic’:
/run/build/zaero/src/player/weapon.c:503:40: error: ‘USHRT_MAX’ undeclared (first use in this function)
  503 |                 (g_swap_speed->value < USHRT_MAX)? (unsigned short int)g_swap_speed->value : 1
      |                                        ^~~~~~~~~
/run/build/zaero/src/player/weapon.c:5:1: note: ‘USHRT_MAX’ is defined in header ‘<limits.h>’; did you forget to ‘#include <limits.h>’?
    4 | #include "../monster/misc/player.h"
  +++ |+#include <limits.h>
    5 | 
/run/build/zaero/src/player/weapon.c:503:40: note: each undeclared identifier is reported only once for each function it appears in
  503 |                 (g_swap_speed->value < USHRT_MAX)? (unsigned short int)g_swap_speed->value : 1
      |                                        ^~~~~~~~~

Full build and logging here:
https://buildbot.flathub.org/#/builders/25/builds/8162/steps/8/logs/stdio

@Eonfge
Copy link
Author

Eonfge commented Sep 15, 2023

Found the commit in question: 0fedfa1

@protocultor Got some sad news for you

@protocultor
Copy link
Contributor

protocultor commented Sep 15, 2023

Yeah, it also happens in the main project and the expansions. What a mess I've made :P
yquake2/yquake2#1057
yquake2/yquake2#1058

The solution in all is the same:
#include <limits.h>
...at the top of the affected file. Will do a PR for all.
EDIT: This PR includes a reference for all the affected expansions:
yquake2/yquake2#1059

@protocultor
Copy link
Contributor

@Eonfge it has been solved, please rebuild.

@Eonfge
Copy link
Author

Eonfge commented Sep 16, 2023

Since Zaero doesn't have an official release yet, I just build the latest version as a test. I'll start with it

@Eonfge
Copy link
Author

Eonfge commented Sep 16, 2023

Works. I'll be distributing the update soon

@Eonfge Eonfge closed this as completed Sep 16, 2023
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

No branches or pull requests

2 participants