diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0d19433..0b106ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -100,7 +100,9 @@ PUBLIC # OS macro $<$:YYCC_OS_WINDOWS> $<$:YYCC_OS_LINUX> + $<$:YYCC_OS_LINUX> # We brutally think Android as Linux. $<$:YYCC_OS_MACOS> + $<$:YYCC_OS_MACOS> # We brutally think iOS as macOS. # Compiler macro $<$:YYCC_CC_GCC> $<$:YYCC_CC_CLANG> @@ -133,15 +135,6 @@ PUBLIC $<$:/Zc:__cplusplus> ) -# Fix GCC std::stacktrace link error -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14) - target_link_libraries(YYCCommonplace PRIVATE stdc++exp) - else () - target_link_libraries(YYCCommonplace PRIVATE stdc++_libbacktrace) - endif () -endif () - # Install binary and headers install(TARGETS YYCCommonplace EXPORT YYCCommonplaceTargets diff --git a/src/yycc/patch/fopen.hpp b/src/yycc/patch/fopen.hpp index f7a025c..e195121 100644 --- a/src/yycc/patch/fopen.hpp +++ b/src/yycc/patch/fopen.hpp @@ -1,5 +1,6 @@ #pragma once #include +#include namespace yycc::patch::fopen { diff --git a/src/yycc/rust/panic.cpp b/src/yycc/rust/panic.cpp index 5d7bb36..3a93a80 100644 --- a/src/yycc/rust/panic.cpp +++ b/src/yycc/rust/panic.cpp @@ -4,13 +4,19 @@ #include #include #include -#include #define TERMCOLOR ::yycc::carton::termcolor #define REINTERPRET ::yycc::string::reinterpret namespace yycc::rust::panic { + // TODO: + // I sadly remove the stacktrace feature for panic function. + // Because in GCC, it has link error (can be fixed by extra link option). + // In Clang, it even lack the whole header file. + // It seems that STL providers are not ready for this feature. So I decide remove it entirely. + // Once every STL probiders have ready for this, I will add it back. + void panic(const char* file, int line, const std::string_view& msg) { // Output message in stderr. auto& dst = std::cerr; @@ -22,9 +28,6 @@ namespace yycc::rust::panic { dst << "program paniked at " << std::quoted(file) << ":Ln" << line << std::endl; // User custom message dst << "note: " << msg << std::endl; - // Stacktrace message if we support it. - dst << "stacktrace: " << std::endl; - dst << std::stacktrace::current() << std::endl; // Restore color dst << REINTERPRET::as_ordinary_view(TERMCOLOR::reset());;