mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
build: Switch to GCC on MacOS (#552)
* build: Experimentally switch to gcc on macOS * build: Corrected gcc paths * build: Enable objective c support on macOS * build: Enable ObjC and ObjC++ on macOS * build: Add ObjC and ObjC++ flags * build: Try compiling objc with clang * build: Remove invalid flags again * fix: Let's not include objc headers in C++ code * sys: Move macos utils code to its own file * fix: Missing unistd include on mac * sys: Removed loader script stuff since it's currently unused and broken * fix: Missing include * fix: Another missing include * fix: CFURLCreateWithBytes wants a pointer to mutable data * fix: Try disabling name mangling of ObjC functions * sys: Move macos utils declarations to its own header file * fix: C Linkage * fix: Move objc function prototypes to C++ headers * fix: More missing includes * fix: Warning error * sys: Call ObjC with C ABI instead of trying to use C++ * build: Update libraries * sys: Fixed build errors * sys: No const correctness I guess * sys: Fixed prototypes * sys: This is C now * sys: More nullptr -> NULL * sys: Fix crash on exit * sys: Try using proper std concepts instead of custom ones * sys: Replaced another hex::is_signed * build: Upgrade to gcc 12 and MacOS Monterey * build: Fixed MacOS runner name * build: Cache correct ccache folder on macOS
This commit is contained in:
@@ -22,7 +22,7 @@ namespace hex::plugin::builtin {
|
||||
else static_assert(hex::always_false<T>::value, "Invalid data type!");
|
||||
}
|
||||
|
||||
template<hex::integral T>
|
||||
template<std::integral T>
|
||||
class DataVisualizerHexadecimal : public hex::ContentRegistry::HexEditor::DataVisualizer {
|
||||
public:
|
||||
DataVisualizerHexadecimal() : DataVisualizer(ByteCount, CharCount) { }
|
||||
@@ -114,7 +114,7 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
};
|
||||
|
||||
template<hex::integral T>
|
||||
template<std::integral T>
|
||||
class DataVisualizerDecimal : public hex::ContentRegistry::HexEditor::DataVisualizer {
|
||||
public:
|
||||
DataVisualizerDecimal() : DataVisualizer(ByteCount, CharCount) { }
|
||||
@@ -123,7 +123,7 @@ namespace hex::plugin::builtin {
|
||||
hex::unused(address, upperCase);
|
||||
|
||||
if (size == ByteCount) {
|
||||
if (hex::is_signed<T>::value)
|
||||
if (std::is_signed<T>::value)
|
||||
ImGui::Text(getFormatString(), static_cast<i64>(*reinterpret_cast<const T*>(data)));
|
||||
else
|
||||
ImGui::Text(getFormatString(), static_cast<u64>(*reinterpret_cast<const T*>(data)));
|
||||
@@ -153,14 +153,14 @@ namespace hex::plugin::builtin {
|
||||
constexpr static inline auto ByteCount = sizeof(T);
|
||||
constexpr static inline auto CharCount = std::numeric_limits<T>::digits10 + 2;
|
||||
|
||||
const static inline auto FormatString = hex::format("%{}{}", CharCount, hex::is_signed<T>::value ? "lld" : "llu");
|
||||
const static inline auto FormatString = hex::format("%{}{}", CharCount, std::is_signed<T>::value ? "lld" : "llu");
|
||||
|
||||
const char *getFormatString() {
|
||||
return FormatString.c_str();
|
||||
}
|
||||
};
|
||||
|
||||
template<hex::floating_point T>
|
||||
template<std::floating_point T>
|
||||
class DataVisualizerFloatingPoint : public hex::ContentRegistry::HexEditor::DataVisualizer {
|
||||
public:
|
||||
DataVisualizerFloatingPoint() : DataVisualizer(ByteCount, CharCount) { }
|
||||
|
||||
@@ -199,11 +199,7 @@ namespace hex::plugin::builtin {
|
||||
reader.seek(this->m_searchPosition.value_or(editor->getSelection().getEndAddress()));
|
||||
|
||||
constexpr static auto searchFunction = [](const auto &haystackBegin, const auto &haystackEnd, const auto &needleBegin, const auto &needleEnd) {
|
||||
#if defined(OS_MACOS)
|
||||
return std::search(haystackBegin, haystackEnd, needleBegin, needleEnd);
|
||||
#else
|
||||
return std::search(haystackBegin, haystackEnd, std::boyer_moore_horspool_searcher(needleBegin, needleEnd));
|
||||
#endif
|
||||
return std::search(haystackBegin, haystackEnd, std::boyer_moore_horspool_searcher(needleBegin, needleEnd));
|
||||
};
|
||||
|
||||
if (!backwards) {
|
||||
|
||||
@@ -117,11 +117,11 @@ namespace hex {
|
||||
for (char *pos = prevPos; *pos != 0x00;) {
|
||||
if (std::isdigit(*pos) || *pos == '.') {
|
||||
auto number = [&] {
|
||||
if constexpr (hex::floating_point<T>)
|
||||
if constexpr (std::floating_point<T>)
|
||||
return std::strtold(pos, &pos);
|
||||
else if constexpr (hex::signed_integral<T>)
|
||||
else if constexpr (std::signed_integral<T>)
|
||||
return std::strtoll(pos, &pos, 10);
|
||||
else if constexpr (hex::unsigned_integral<T>)
|
||||
else if constexpr (std::unsigned_integral<T>)
|
||||
return std::strtoull(pos, &pos, 10);
|
||||
else
|
||||
static_assert(hex::always_false<T>::value, "Can't parse literal of this type");
|
||||
@@ -440,7 +440,7 @@ namespace hex {
|
||||
|
||||
template<typename T>
|
||||
void MathEvaluator<T>::registerStandardFunctions() {
|
||||
if constexpr (hex::floating_point<T>) {
|
||||
if constexpr (std::floating_point<T>) {
|
||||
this->setFunction(
|
||||
"sin", [](auto args) { return std::sin(args[0]); }, 1, 1);
|
||||
this->setFunction(
|
||||
|
||||
Reference in New Issue
Block a user