Skip to content

build system attempts to include non-CE headers #761

@ZERICO2005

Description

@ZERICO2005

The CE C/C++ toolchain does not have <unistd.h>. However __has_include(<unistd.h>) returns true when compiling on Linux. We should probably look into possibly constraining where CEdev looks for header files.

#if __has_include(<unistd.h>)
#  include <unistd.h> // _POSIX_TIMERS
#endif

This can define symbols that conflict with the CE C/C++ headers, or possibly lead to errors similar to the one showed below:

zerico@DESKTOP-7OMIH9B:~/programming/toolchain/src/libcxx$ make
make -C src
make[1]: Entering directory '/home/zerico/programming/toolchain/src/libcxx/src'
In file included from chrono.cpp:27:
In file included from /usr/include/unistd.h:25:
In file included from /usr/include/features.h:394:
/usr/include/features-time64.h:20:10: fatal error: 'bits/wordsize.h' file not found
   20 | #include <bits/wordsize.h>
      |          ^~~~~~~~~~~~~~~~~
1 error generated.
make[1]: *** [makefile:81: build/chrono.cpp.src] Error 1

The problem goes away if I do this, but this is tedious.

#if !defined(_EZ80) && __has_include(<unistd.h>)
#  include <unistd.h> // _POSIX_TIMERS
#endif

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions