From d2d8e2fa52c5633f6376e4d3b1d7aca9a9ea14b0 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Tue, 25 Aug 2026 19:35:41 -0400 Subject: File fixes Signed-off-by: Andrew Opalach --- src/util/file/file.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/util/file/file.h') diff --git a/src/util/file/file.h b/src/util/file/file.h index 4df4c96..77344f8 100644 --- a/src/util/file/file.h +++ b/src/util/file/file.h @@ -3,6 +3,15 @@ #include #include +/* +#if defined NAUNET_ON_WINDOWS && defined AL_WE_32BIT +AL_ASSERT_TYPE_SIZE(off_t, 4); +#else +AL_ASSERT_TYPE_SIZE(off_t, 8); +#endif +*/ +AL_ASSERT_TYPE_SIZE(off_t, 8); + #ifdef NAUNET_NEEDS_STDIO_ASSIST // It seems meson adds _FILE_OFFSET_BITS=64 on all "linuxlike" compilers even MinGW. // https://github.com/mesonbuild/meson/commit/853634a48da025c59eef70161dba0d150833f60d @@ -52,7 +61,7 @@ struct nn_file { #endif #endif str path; - size_t size; + off_t size; }; struct nn_dir { @@ -77,7 +86,11 @@ struct nn_dir_entry { #endif }; +void nn_path_append(str *path, str *part); +void nn_path_prepend(str *path, str *part); + bool nn_file_open(struct nn_file *file, str *path, s32 flags); +bool nn_file_wrap_fd(struct nn_file *file, s32 fd); bool nn_file_exists(str *path); bool nn_file_create(str *path); bool nn_file_truncate(struct nn_file *file, off_t size); -- cgit v1.2.3-101-g0448