mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-09-11 13:25:42 +03:00
use defines for unreachable
This commit is contained in:
parent
c998e946aa
commit
6e16dfa5e5
@ -54,6 +54,12 @@
|
||||
|
||||
#define ASSERT(expr) RASSERT(expr, "?")
|
||||
|
||||
#if ISDEBUG
|
||||
#define UNREACHABLE() { Debug::log(CRIT, "\n\nMEMORY CORRUPTED: Unreachable failed! (Reached an unreachable position, memory corruption!!!)"); *((int*)nullptr) = 1; }
|
||||
#else
|
||||
#define UNREACHABLE() std::unreachable();
|
||||
#endif
|
||||
|
||||
// git stuff
|
||||
#ifndef GIT_COMMIT_HASH
|
||||
#define GIT_COMMIT_HASH "?"
|
||||
|
@ -129,10 +129,12 @@ public:
|
||||
case AVARTYPE_COLOR:
|
||||
return m_cValue != m_cGoal;
|
||||
default:
|
||||
std::unreachable();
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
std::unreachable();
|
||||
UNREACHABLE();
|
||||
|
||||
return false; // just so that the warning is suppressed
|
||||
}
|
||||
|
||||
void warp() {
|
||||
@ -150,7 +152,7 @@ public:
|
||||
break;
|
||||
}
|
||||
default:
|
||||
std::unreachable();
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user