got bored and kinda rewrote GN_DEBUGGER_LAYER_FUNCTIONS
This commit is contained in:
32
projects/validation_layers/function_loader/loader_utils.h
Normal file
32
projects/validation_layers/function_loader/loader_utils.h
Normal 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__);
|
Reference in New Issue
Block a user