Files
st/libs/cpp/include/limits
T
Yanis b116e79e9f Decompile overlay 1 (Part 2) (#91)
* UnkStruct_027e09b8_001 OK

* match func_ov001_020b7830

* fix build issues

* UnkStruct_027e0cd8_001 49%

* UnkStruct_027e0cd8_001 OK

* fix build issues

* UnkStruct_027e0cd8_0C_001 92%

* port some MSL C++ headers from rb3 and key decomps

* fix build issues

* UnkStruct_027e0cd8_0C_001 98%
2026-06-28 15:29:34 +02:00

132 lines
3.2 KiB
Plaintext

#ifndef _STD_LIMITS_H
#define _STD_LIMITS_H
// from rb3 decomp
// Based on https://github.com/SwareJonge/mkdd/blob/main/libs/PowerPC_EABI_Support/include/limits
namespace std {
template <typename T>
class numeric_limits {
public:
static T min();
static T max();
};
template <>
class numeric_limits<bool> {
public:
static bool min() { return false; }
static bool max() { return true; }
};
template <>
class numeric_limits<char> {
public:
static char min() { return -0x80; }
static char max() { return 0x7F; }
};
template <>
class numeric_limits<signed char> {
public:
static signed char min() { return -0x80; }
static signed char max() { return 0x7F; }
};
template <>
class numeric_limits<unsigned char> {
public:
static unsigned char min() { return 0x0; }
static unsigned char max() { return 0xFF; }
};
// template <>
// class numeric_limits<short> {
// public:
// static short min() { return -0x8000; }
// static short max() { return 0x7FFF; }
// };
template <>
class numeric_limits<signed short> {
public:
static signed short min() { return -0x8000; }
static signed short max() { return 0x7FFF; }
};
template <>
class numeric_limits<unsigned short> {
public:
static unsigned short min() { return 0x0; }
static unsigned short max() { return 0xFFFF; }
};
// template <>
// class numeric_limits<int> {
// public:
// static int min() { return -0x80000000; }
// static int max() { return 0x7FFFFFFF; }
// };
template <>
class numeric_limits<signed int> {
public:
static signed int min() { return -0x80000000; }
static signed int max() { return 0x7FFFFFFF; }
};
template <>
class numeric_limits<unsigned int> {
public:
static unsigned int min() { return 0x0; }
static unsigned int max() { return 0xFFFFFFFF; }
};
// template <>
// class numeric_limits<long> {
// public:
// static long min() { return -0x80000000; }
// static long max() { return 0x7FFFFFFF; }
// };
template <>
class numeric_limits<signed long> {
public:
static signed long min() { return -0x80000000; }
static signed long max() { return 0x7FFFFFFF; }
};
template <>
class numeric_limits<unsigned long> {
public:
static unsigned long min() { return 0x0; }
static unsigned long max() { return 0xFFFFFFFF; }
};
// template <>
// class numeric_limits<long long> {
// public:
// static long long min() { return -0x8000000000000000; }
// static long long max() { return 0x7FFFFFFFFFFFFFFF; }
// };
template <>
class numeric_limits<signed long long> {
public:
static signed long long min() { return -0x8000000000000000; }
static signed long long max() { return 0x7FFFFFFFFFFFFFFF; }
};
template <>
class numeric_limits<unsigned long long> {
public:
static unsigned long long min() { return 0x0; }
static unsigned long long max() { return 0xFFFFFFFFFFFFFFFF; }
};
}
#endif