Closed codecat closed 3 months ago
yeah, I suspected that the LibC.h
would break on some other platforms other than the ones I am actively testing (that is mainly Ubuntu regarding to Linux).
I think I got a similar problem with the memchr
function that has C++ mangling when including some LibC header from C++ files.
As this can grow very complicated soon if you try to handle all possible linux distros, I was thinking to add a "Safety" mode where on unknown platforms I would just include the proper headers from the host toolchain...
I'm wondering if there is a way to know in the header if I am on an ubuntu system vs a Fedora system or other distros 🤔
I just ran into another problem which I assume is related then?
In file included from /home/nimble/dev/example/thirdparty/sc/Libraries/FileSystemIterator/../File/../Foundation/Span.h:4,
from /home/nimble/dev/example/thirdparty/sc/Libraries/FileSystemIterator/../File/FileDescriptor.h:5,
from /home/nimble/dev/example/thirdparty/sc/Libraries/FileSystemIterator/FileSystemIterator.h:4,
from /home/nimble/dev/example/main.cpp:4:
/home/nimble/dev/example/thirdparty/sc/Libraries/FileSystemIterator/../File/../Foundation/../Foundation/InitializerList.h:8:7: error: redefinition of ‘class std::initializer_list<_E>’
8 | class initializer_list
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/bits/range_access.h:36,
from /usr/include/c++/13/string:53,
from /home/nimble/dev/example/build/_deps/hello_imgui-src/src/hello_imgui/../hello_imgui/hello_imgui_assets.h:2,
from /home/nimble/dev/example/build/_deps/hello_imgui-src/src/hello_imgui/../hello_imgui/hello_imgui.h:9,
from /home/nimble/dev/example/main.cpp:1:
/usr/include/c++/13/initializer_list:45:11: note: previous definition of ‘class std::initializer_list<_E>’
45 | class initializer_list
| ^~~~~~~~~~~~~~~~
yes that's the same problem, the "safety mode" should also include
I will be working on fixing this btw.
Ok I see the issue.
If you compile the SC.cpp
unity build file with -fno-rtti -fno-exceptions
it should work fine.
I think I need to add this to the "how to use / integrate in your project" instructions.
If I can detect whether these flags are on or off I could also probably tackle the required changes automatically
Hi @codecat , I have been also doing some additional fixes.
Now if you pull the latest main branch and compile with exceptions enabled, LibC.h will include SC_COMPILER_ENABLE_STD_CPP=1
and that should take care of the <initializer_list>
issue.
Please let me know if this is fixing your issues.
Looks to be working! Thanks for the fixes! :tada:
I'm getting the following compilation failure. Looks like the functions in
LibC.h
are missingnoexcept(true)
.This is on gcc 13.2.1 on Fedora.