Fix persistent global mapping
This commit is contained in:
@@ -10,31 +10,31 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
// Fallback to int if type is not annotated
|
||||
struct undefined {
|
||||
size_t _0;
|
||||
undefined(int i) {
|
||||
*this = i;
|
||||
}
|
||||
undefined(uint32_t i) {
|
||||
*this = i;
|
||||
}
|
||||
undefined(void* i) {
|
||||
reinterpret_cast<void*&>(_0) = i;
|
||||
}
|
||||
undefined(uint64_t i) {
|
||||
*this = i;
|
||||
}
|
||||
undefined() = default;
|
||||
template <typename T> operator T&() {
|
||||
static_assert(sizeof(T) <= sizeof(_0), "Invalid assignment");
|
||||
return reinterpret_cast<T&>(_0);
|
||||
}
|
||||
template <typename T> T& operator=(const T &other) {
|
||||
static_assert(sizeof(T) <= sizeof(_0), "Invalid assignment");
|
||||
return reinterpret_cast<T&>(_0) = other;
|
||||
}
|
||||
};
|
||||
// struct undefined {
|
||||
// size_t _0;
|
||||
// undefined(int i) {
|
||||
// *this = i;
|
||||
// }
|
||||
// undefined(uint32_t i) {
|
||||
// *this = i;
|
||||
// }
|
||||
// undefined(void* i) {
|
||||
// reinterpret_cast<void*&>(_0) = i;
|
||||
// }
|
||||
// undefined(uint64_t i) {
|
||||
// *this = i;
|
||||
// }
|
||||
// undefined() = default;
|
||||
// template <typename T> operator T&() {
|
||||
// static_assert(sizeof(T) <= sizeof(_0), "Invalid assignment");
|
||||
// return reinterpret_cast<T&>(_0);
|
||||
// }
|
||||
// template <typename T> T& operator=(const T &other) {
|
||||
// static_assert(sizeof(T) <= sizeof(_0), "Invalid assignment");
|
||||
// return reinterpret_cast<T&>(_0) = other;
|
||||
// }
|
||||
// };
|
||||
typedef uint8_t undefined;
|
||||
typedef uint32_t undefined4;
|
||||
typedef uint16_t undefined2;
|
||||
struct undefined3 {
|
||||
|
Reference in New Issue
Block a user