got bored and kinda rewrote GN_DEBUGGER_LAYER_FUNCTIONS

This commit is contained in:
Gregory Wells
2025-07-09 19:37:04 -04:00
parent a393d7b5b7
commit 0fe87e1e84
14 changed files with 160 additions and 280 deletions

View File

@@ -0,0 +1,32 @@
#define CHECK_FUNCTION_WITH_RETURN_CODE(instance, function, type, ...) \
loaderLayer* nextLayer = loaderGetNextLayer(instance); \
if (nextLayer->type.function == NULL) { \
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){ \
.message = gnCreateString("Failed to load " #function " this indicates a bug within gryphn") \
}); \
resetLayer(instance); \
return GN_FAILED_TO_LOAD_FUNCTION; \
} \
return nextLayer->type.function(__VA_ARGS__);
#define CHECK_RETURNED_FUNCTION(instance, function, type, fail_return, ...) \
loaderLayer* nextLayer = loaderGetNextLayer(instance); \
if (nextLayer->type.function == NULL) { \
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){ \
.message = gnCreateString("Failed to load " #function " this indicates a bug within gryphn") \
}); \
resetLayer(instance); \
return fail_return; \
} \
return nextLayer->type.function(__VA_ARGS__);
#define CHECK_VOID_FUNCTION(instance, function, type, ...) \
loaderLayer* nextLayer = loaderGetNextLayer(instance); \
if (nextLayer->type.function == NULL) { \
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){ \
.message = gnCreateString("Failed to load " #function " this indicates a bug within gryphn") \
}); \
resetLayer(instance); \
return; \
} \
nextLayer->type.function(__VA_ARGS__);