Closed glebm closed 5 years ago
Declaring a function in my own code was enough to make it build
// Work around https://github.com/devkitPro/newlib/issues/15
#ifdef __SWITCH__
extern "C" int ftruncate(int, off_t);
#endif
You're building with some option that switches off BSD extensions, i.e. -std= or similar. You can re-enable these by using gnu standards or defining appropriate feature test macros.
Try -D_BSD_SOURCE or -D_GNU_SOURCE
This is a devilutionx bug, not a devkitA64 bug.
Thanks! We do indeed compile with -std=c++11
.
I've now defined -D_POSIX_C_SOURCE=200809L
and it compiles. Didn't realize this was a POSIX function.
I'm using the latest dpkg and cmake
devilutionX/3rdParty/StormLib/src/StormPort.h:279:23: error: 'ftruncate' was not declared in this scope
<unistd.h>
is included