2025-07-20 14:20 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004737Spring enginepublic2015-04-09 04:16
ReporterUnitedMarsupials 
Assigned Toabma 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version98.0 
Target VersionFixed in Version 
Summary0004737: PATH_MAX may be undefined compiling rts/System/Platform/Misc.cpp
DescriptionSomehow clang++ has no problem, but, when I used g++49, I got the following error:

/home/ports/games/spring/work/spring_98.0/rts/System/Platform/Misc.cpp:228:11: error: 'PATH_MAX' was not declared in this scope
  char buf[PATH_MAX];
           ^
/home/ports/games/spring/work/spring_98.0/rts/System/Platform/Misc.cpp:229:21: error: 'buf' was not declared in this scope
  size_t cb = sizeof(buf);
Steps To ReproduceTry building on FreeBSD-10.1 with g++49.
Additional InformationThe attached patch fixes the problem properly -- it gets rid of the static value completely and uses pathconf() instead.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0014306

abma (administrator)

Last edited: 2015-04-09 04:13

View 3 revisions

does climits define PATH_MAX?

i.e. #include <climits> ?

~0014307

abma (administrator)

Fix 1af59c6de9c94b185094c4523a2038b2f04d2a8e committed to develop branch: fix 0004737:

compile error on FreeBSD, repo: spring changeset id: 4801

~0014308

abma (administrator)

didn't see that the code is already #if defined(__FreeBSD__):

thanks, applied the patch!


github pull requests are very welcome, they simplify applying patches & gives you directly the credits :)
+Notes

-Issue History
Date Modified Username Field Change
2015-04-09 02:11 UnitedMarsupials New Issue
2015-04-09 02:11 UnitedMarsupials File Added: patch-rts-System-Platform-Misc
2015-04-09 04:08 abma Note Added: 0014306
2015-04-09 04:12 abma Note Edited: 0014306 View Revisions
2015-04-09 04:13 abma Note Edited: 0014306 View Revisions
2015-04-09 04:15 abma Changeset attached => spring develop 1af59c6d
2015-04-09 04:15 abma Note Added: 0014307
2015-04-09 04:15 abma Assigned To => abma
2015-04-09 04:15 abma Status new => resolved
2015-04-09 04:15 abma Resolution open => fixed
2015-04-09 04:16 abma Note Added: 0014308
+Issue History