Use macros to improve safety loading callbacks
Just a minor fix mostly because I noticed that I kept accidentally forgetting to add checks to the code properly. This is one of those cases where macros come in useful, as macros can automate the process and help prevent these mistakes from happening by accident.
This commit is contained in:
@@ -32,6 +32,14 @@
|
||||
#include "obs-service.h"
|
||||
#include "obs-encoder.h"
|
||||
|
||||
#define LOAD_MODULE_SUBFUNC(name, required) \
|
||||
do { \
|
||||
info->name = load_module_subfunc(module, module_name, \
|
||||
id, #name, required); \
|
||||
if (required && !info->name) \
|
||||
return false; \
|
||||
} while (false)
|
||||
|
||||
#define NUM_TEXTURES 2
|
||||
|
||||
struct obs_display {
|
||||
|
Reference in New Issue
Block a user