Add cc_uint8 definitions for metrowerks

Don't be fooled though, compiling for that is still completely broken
This commit is contained in:
UnknownShadow200 2019-08-25 21:50:21 +10:00
parent 72fb33f9b6
commit 363f28f52b
5 changed files with 15 additions and 6 deletions

View File

@ -59,8 +59,17 @@ typedef unsigned __INTPTR_TYPE__ cc_uintptr;
#endif
#endif
#elif __MWERKS__
typedef signed char cc_int8;
typedef signed short cc_int16;
typedef signed int cc_int32;
typedef signed long long cc_int64;
typedef unsigned char cc_uint8;
typedef unsigned short cc_uint16;
typedef unsigned int cc_uint32;
typedef unsigned long long cc_uint64;
typedef unsigned int cc_uintptr;
/* TODO: Is there actual attribute support for these somewhere? */
#include <stdint.h>
#define CC_INLINE inline
#define CC_NOINLINE
#define CC_API

View File

@ -333,7 +333,7 @@ static void Logger_DumpFrame(String* trace, void* addr) {
/* android's bionic libc doesn't provide backtrace (execinfo.h) */
#include <unwind.h>
static _Unwind_Reason_Code Logger_DumpFrame(struct _Unwind_Context* ctx, void* arg) {
static _Unwind_Reason_Code Logger_UnwindFrame(struct _Unwind_Context* ctx, void* arg) {
cc_uintptr addr = _Unwind_GetIP(ctx);
if (!addr) return _URC_END_OF_STACK;
@ -342,7 +342,7 @@ static _Unwind_Reason_Code Logger_DumpFrame(struct _Unwind_Context* ctx, void* a
}
void Logger_Backtrace(String* trace, void* ctx) {
_Unwind_Backtrace(Logger_DumpFrame, trace);
_Unwind_Backtrace(Logger_UnwindFrame, trace);
String_AppendConst(trace, _NL);
}
#elif defined CC_BUILD_OSX

View File

@ -1942,7 +1942,7 @@ static void MenuOptionsScreen_Enum(void* screen, void* widget) {
struct ButtonWidget* btn = (struct ButtonWidget*)widget;
int index;
struct MenuInputDesc* desc;
const char** names;
const char* const* names;
int raw, count;
index = Menu_Index(s, btn);

View File

@ -87,7 +87,7 @@ float Options_GetFloat(const char* key, float min, float max, float defValue) {
return value;
}
int Options_GetEnum(const char* key, int defValue, const char** names, int namesCount) {
int Options_GetEnum(const char* key, int defValue, const char* const* names, int namesCount) {
String str;
if (!Options_UNSAFE_Get(key, &str)) return defValue;
return Utils_ParseEnum(&str, defValue, names, namesCount);

View File

@ -84,7 +84,7 @@ CC_API bool Options_GetBool(const char* key, bool defValue);
CC_API float Options_GetFloat(const char* key, float min, float max, float defValue);
/* Returns value of given option as an integer, or defalt value if could not be converted. */
/* NOTE: Conversion is done by going through all elements of names, returning index of a match. */
CC_API int Options_GetEnum(const char* key, int defValue, const char** names, int namesCount);
CC_API int Options_GetEnum(const char* key, int defValue, const char* const* names, int namesCount);
/* Sets value of given option to either "true" or "false". */
CC_API void Options_SetBool(const char* keyRaw, bool value);