nxdk
nxdk copied to clipboard
Missing sys/stat.h
Here's a hack I've been using locally:
echo "#pragma once // Generated" > $NXDK_DIR/lib/xboxrt/libc_extensions/sys/stat.h
echo "#include <stddef.h>" >> $NXDK_DIR/lib/xboxrt/libc_extensions/sys/stat.h
echo "struct _stat { size_t st_size; int st_mode; int st_mtime; int st_atime; int st_nlink; };" >> $NXDK_DIR/lib/xboxrt/libc_extensions/sys/stat.h
echo "struct _stati64 { size_t st_size; int st_mode; int st_mtime; int st_atime; int st_nlink; };" >> $NXDK_DIR/lib/xboxrt/libc_extensions/sys/stat.h
echo "static int _stati64(const char* x, ...) { return 0; };" >> $NXDK_DIR/lib/xboxrt/libc_extensions/sys/stat.h
I hope that someone will implement this properly.
There's more functionality in this, but this is enough for my current projects
My view on this would be that we shouldn’t fix this: sys/stat.h is a POSIX/UNIX api and should not be assumed to be present in non-posix environments such as Xbox.
Yeah I agree, will fix this on DevilutionX side (same for sys/types.h)
I initially was under the wrong impression that NXDK aims to be somewhat POSIX compatible