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

[BUG] Missing include for FreeBSD #2248

Closed
1 task done
interkosmos opened this issue Nov 7, 2023 · 3 comments
Closed
1 task done

[BUG] Missing include for FreeBSD #2248

interkosmos opened this issue Nov 7, 2023 · 3 comments
Labels

Comments

@interkosmos
Copy link

GZDoom version

GZDoom 4.11.1

Which game are you running with GZDoom?

None

What Operating System are you using?

Other

Please describe your specific OS version

FreeBSD 13

Relevant hardware info

No response

Have you checked that no other similar issue already exists?

  • I have searched and not found similar issues.

A clear and concise description of what the bug is.

In file src/common/filesystem/source/fs_findfile.cpp, the following FreeBSD-specific include is missing before the include of unistd.h:

#ifdef __FreeBSD__
#include <sys/time.h>
#endif

Steps to reproduce the behaviour.

Explain how to reproduce
1.
2.
3.

Your configuration

No response

Provide a Log

No response

@interkosmos interkosmos added the bug label Nov 7, 2023
@alexey-lysiuk
Copy link
Collaborator

What is the compilation error without this include?

@interkosmos
Copy link
Author

Build error without the include:

[ 99%] Building CXX object src/CMakeFiles/zdoom.dir/common/filesystem/source/fs_findfile.cpp.o
In file included from /tmp/gzdoom/src/common/filesystem/source/fs_findfile.cpp:69:
In file included from /usr/include/sys/stat.h:101:
/usr/include/sys/time.h:327:5: error: member access into incomplete type 'struct timeval'
        _tv->tv_sec = _bt->sec;
           ^
/usr/include/unistd.h:487:8: note: forward declaration of 'FileSys::timeval'
struct timeval;                         /* select(2) */
       ^
In file included from /tmp/gzdoom/src/common/filesystem/source/fs_findfile.cpp:69:
In file included from /usr/include/sys/stat.h:101:
/usr/include/sys/time.h:328:5: error: member access into incomplete type 'struct timeval'
        _tv->tv_usec = __utime64_scale64_floor(
           ^
/usr/include/unistd.h:487:8: note: forward declaration of 'FileSys::timeval'
struct timeval;                         /* select(2) */
       ^
In file included from /tmp/gzdoom/src/common/filesystem/source/fs_findfile.cpp:69:
In file included from /usr/include/sys/stat.h:101:
/usr/include/sys/time.h:336:16: error: member access into incomplete type 'const struct timeval'
        _bt->sec = _tv->tv_sec;
                      ^
/usr/include/unistd.h:487:8: note: forward declaration of 'FileSys::timeval'
struct timeval;                         /* select(2) */
       ^
In file included from /tmp/gzdoom/src/common/filesystem/source/fs_findfile.cpp:69:
In file included from /usr/include/sys/stat.h:101:
/usr/include/sys/time.h:338:19: error: member access into incomplete type 'const struct timeval'
            (uint64_t)_tv->tv_usec << 32, 1ULL << 32, 1000000);
                         ^
/usr/include/unistd.h:487:8: note: forward declaration of 'FileSys::timeval'
struct timeval;                         /* select(2) */
       ^
In file included from /tmp/gzdoom/src/common/filesystem/source/fs_findfile.cpp:69:
In file included from /usr/include/sys/stat.h:101:
/usr/include/sys/time.h:359:1: error: incomplete result type 'struct timeval' in function definition
sbttotv(sbintime_t _sbt)
^
/usr/include/unistd.h:487:8: note: forward declaration of 'FileSys::timeval'
struct timeval;                         /* select(2) */
       ^
In file included from /tmp/gzdoom/src/common/filesystem/source/fs_findfile.cpp:69:
In file included from /usr/include/sys/stat.h:101:
/usr/include/sys/time.h:361:17: error: variable has incomplete type 'struct timeval'
        struct timeval _tv;
                       ^
/usr/include/unistd.h:487:8: note: forward declaration of 'FileSys::timeval'
struct timeval;                         /* select(2) */
       ^
In file included from /tmp/gzdoom/src/common/filesystem/source/fs_findfile.cpp:69:
In file included from /usr/include/sys/stat.h:101:
/usr/include/sys/time.h:369:24: error: variable has incomplete type 'struct timeval'
tvtosbt(struct timeval _tv)
                       ^
/usr/include/unistd.h:487:8: note: forward declaration of 'FileSys::timeval'
struct timeval;                         /* select(2) */
       ^
In file included from /tmp/gzdoom/src/common/filesystem/source/fs_findfile.cpp:69:
In file included from /usr/include/sys/stat.h:101:
/usr/include/sys/time.h:476:17: error: field has incomplete type 'struct timeval'
        struct  timeval it_interval;    /* timer interval */
                        ^
/usr/include/unistd.h:487:8: note: forward declaration of 'FileSys::timeval'
struct timeval;                         /* select(2) */
       ^
In file included from /tmp/gzdoom/src/common/filesystem/source/fs_findfile.cpp:69:
In file included from /usr/include/sys/stat.h:101:
/usr/include/sys/time.h:477:17: error: field has incomplete type 'struct timeval'
        struct  timeval it_value;       /* current value */
                        ^
/usr/include/unistd.h:487:8: note: forward declaration of 'FileSys::timeval'
struct timeval;                         /* select(2) */
       ^
9 errors generated.

@coelckers
Copy link
Member

FreeBSD really needs to fix its headers.

TwelveEyes pushed a commit to TwelveEyes/gzdoom that referenced this issue Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants