Cleanup: use static assert to disable access to preferences
Prefer this over an unknown identifier as it gives a useful error.
This commit is contained in:
@@ -260,8 +260,8 @@ static void userdef_free_addons(UserDef *userdef)
|
||||
*/
|
||||
void BKE_blender_userdef_data_free(UserDef *userdef, bool clear_fonts)
|
||||
{
|
||||
#define U _invalid_access_ /* ensure no accidental global access */
|
||||
#ifdef U /* quiet warning */
|
||||
#define U BLI_STATIC_ASSERT(false, "Global 'U' not allowed, only use arguments passed in!")
|
||||
#ifdef U /* quiet warning */
|
||||
#endif
|
||||
|
||||
userdef_free_keymaps(userdef);
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
|
||||
#include "wm_event_types.h"
|
||||
|
||||
/* Disallow access to global userdef. */
|
||||
#define U (_error_)
|
||||
/* For versioning we only ever want to manipulate preferences passed in. */
|
||||
#define U BLI_STATIC_ASSERT(false, "Global 'U' not allowed, only use arguments passed in!")
|
||||
|
||||
static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user