Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_internal.h
| Context not available. | |||||
| PointerRNA rna_pointer_inherit_refine(struct PointerRNA *ptr, struct StructRNA *type, void *data); | PointerRNA rna_pointer_inherit_refine(struct PointerRNA *ptr, struct StructRNA *type, void *data); | ||||
| #ifdef __cplusplus | |||||
| # define MAX_ALIGN_T std::max_align_t | |||||
| # define NULLPTR nullptr | |||||
| # define STATIC_ASSERT(_condition, _message, _unique_num) static_assert(_condition, _message) | |||||
| #else | |||||
| # define MAX_ALIGN_T max_align_t | |||||
| # define NULLPTR NULL | |||||
| # if 0 /* This seems less robust than the array index trick */ | |||||
| # define STATIC_ASSERT(_condition, _message, _unique_num) _Static_assert(_condition, _message) | |||||
| # else /* Array index technique*/ | |||||
| # ifndef MAYBE_UNUSED | |||||
| # ifdef __GNUC__ | |||||
| # define MAYBE_UNUSED __attribute__((unused)) | |||||
| # else | |||||
| # define MAYBE_UNUSED | |||||
| # endif | |||||
| # endif | |||||
| # define STATIC_ASSERT_ARRAY_NAME(_line, _unique_num) assert_array_##_line##_##_unique_num | |||||
| # define STATIC_ASSERT(_condition, _message, _unique_num) \ | |||||
| { \ | |||||
| char STATIC_ASSERT_ARRAY_NAME(__LINE__, _unique_num)[(_condition) ? 1 : -1] MAYBE_UNUSED; \ | |||||
| } | |||||
| # endif | |||||
| # include <stdalign.h> | |||||
| #endif /* __cplusplus */ | |||||
| enum { | |||||
| RNA_PARAMETER_INFO__COUNT__NOT_AN_ARRAY = 0, /* See `ParameterInfo.count` below. */ | |||||
| RNA_PARAMETER_INFO__ALIGNMENT__MAXIMUM = alignof(MAX_ALIGN_T) | |||||
| }; | |||||
| /* Info about a parameter's size and alignment. */ | |||||
| struct ParameterInfo { | |||||
| /* Total size of parameter */ | |||||
| size_t size; | |||||
| /* Element count if parameter is an array. (`RNA_PARAMETER_INFO__COUNT__NOT_AN_ARRAY` | |||||
| * indicates a non-array.) */ | |||||
| size_t count; | |||||
| /* Alignment of the parameter. (This will often be `size / MAX(1,count)`.) */ | |||||
| size_t alignment; | |||||
| /* String constant name of builtin type (or equivilant). NULL indicates a | |||||
| * non-builtin type that may not be defined when later referenced. */ | |||||
| const char *c_type_name; | |||||
| /* String constant name of original type. This should only be NULL when | |||||
| * c_type_name is non-NULL, and accurately represents the original type name. */ | |||||
| const char *orig_type_name; | |||||
| }; | |||||
| /* Functions */ | /* Functions */ | ||||
| int rna_parameter_size(struct PropertyRNA *parm); | struct ParameterInfo rna_parameter_info(PropertyRNA *parm); | ||||
| size_t rna_compute_parameter_padding(size_t size_so_far, | |||||
| size_t this_parm_size, | |||||
| size_t next_parm_alignment); | |||||
| /* XXX, these should not need to be defined here~! */ | /* XXX, these should not need to be defined here~! */ | ||||
| struct MTex *rna_mtex_texture_slots_add(struct ID *self, | struct MTex *rna_mtex_texture_slots_add(struct ID *self, | ||||
| Context not available. | |||||