Blender  V3.3
DNA_defaults.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
10 #pragma once
11 
12 #include "BLI_utildefines.h"
13 
14 #include "dna_type_offsets.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 extern const void *DNA_default_table[SDNA_TYPE_MAX];
21 
23  size_t size,
24  const char *alloc_str);
25 
29 #define DNA_struct_default_get(struct_name) \
30  (const struct_name *)DNA_default_table[SDNA_TYPE_FROM_STRUCT(struct_name)]
31 
32 #define DNA_struct_default_alloc(struct_name) \
33  (struct_name *)_DNA_struct_default_alloc_impl( \
34  (const uint8_t *)DNA_default_table[SDNA_TYPE_FROM_STRUCT(struct_name)], \
35  sizeof(struct_name), \
36  __func__)
37 
38 #ifdef __cplusplus
39 }
40 #endif
uint8_t * _DNA_struct_default_alloc_impl(const uint8_t *data_src, size_t size, const char *alloc_str)
Definition: dna_defaults.c:564
const void * DNA_default_table[SDNA_TYPE_MAX]
Definition: dna_defaults.c:346
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
unsigned char uint8_t
Definition: stdint.h:78