Blender  V2.93
DNA_defaults.h
Go to the documentation of this file.
1 
2 /*
3  * This program is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU General Public License
5  * as published by the Free Software Foundation; either version 2
6  * of the License, or (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software Foundation,
15  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16  *
17  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
18  * All rights reserved.
19  */
20 
27 #pragma once
28 
29 #include "BLI_utildefines.h"
30 
31 #include "dna_type_offsets.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 extern const void *DNA_default_table[SDNA_TYPE_MAX];
38 
39 char *_DNA_struct_default_alloc_impl(const char *data_src, size_t size, const char *alloc_str);
40 
44 #define DNA_struct_default_get(struct_name) \
45  (const struct_name *)DNA_default_table[SDNA_TYPE_FROM_STRUCT(struct_name)]
46 
47 #define DNA_struct_default_alloc(struct_name) \
48  (struct_name *)_DNA_struct_default_alloc_impl( \
49  DNA_default_table[SDNA_TYPE_FROM_STRUCT(struct_name)], sizeof(struct_name), __func__)
50 
51 #ifdef __cplusplus
52 }
53 #endif
const void * DNA_default_table[SDNA_TYPE_MAX]
Definition: dna_defaults.c:345
char * _DNA_struct_default_alloc_impl(const char *data_src, size_t size, const char *alloc_str)
Definition: dna_defaults.c:548
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52