Cleanup: correct usage of extern-C blocks in various places

This removes extern-C blocks around other includes and adds
such blocks for some headers that need them.
This commit is contained in:
Jacques Lucke 2020-07-28 16:32:30 +02:00
parent 9c1da81a4c
commit b274d18aec
94 changed files with 483 additions and 72 deletions

View File

@ -19,13 +19,11 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BKE_fcurve.h"
#include "ED_keyframing.h"
#include "DNA_anim_types.h"
}
namespace blender::bke::tests {

View File

@ -26,9 +26,7 @@
using namespace std;
extern "C" {
#include "BKE_appdir.h"
}
namespace Freestyle {

View File

@ -33,7 +33,6 @@
#include "../view_map/Silhouette.h"
#include "../view_map/ViewMap.h"
extern "C" {
#include "BLI_blenlib.h"
#include "IMB_imbuf.h"
@ -45,7 +44,6 @@ extern "C" {
#endif
#include "FRS_freestyle.h"
}
namespace Freestyle {

View File

@ -37,7 +37,6 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
@ -56,7 +55,6 @@ extern "C" {
#include "BLI_iterator.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
}
#include "DEG_depsgraph_query.h"

View File

@ -34,8 +34,6 @@ using namespace Freestyle;
#include "MEM_guardedalloc.h"
extern "C" {
#include "DNA_camera_types.h"
#include "DNA_collection_types.h"
#include "DNA_freestyle_types.h"
@ -65,6 +63,8 @@ extern "C" {
#include "FRS_freestyle.h"
extern "C" {
#define DEFAULT_SPHERE_RADIUS 1.0f
#define DEFAULT_DKR_EPSILON 0.0f

View File

@ -37,10 +37,8 @@
#include "BKE_global.h"
extern "C" {
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
}
namespace Freestyle {

View File

@ -34,7 +34,6 @@ extern "C" {
#include "MEM_guardedalloc.h"
// soc
extern "C" {
#include "DNA_text_types.h"
#include "BKE_context.h"
@ -47,7 +46,6 @@ extern "C" {
#include "BPY_extern.h"
#include "bpy_capi_utils.h"
}
namespace Freestyle {

View File

@ -22,9 +22,7 @@
* \brief Classes defining the basic "Iterator" design pattern
*/
extern "C" {
#include "render_types.h"
}
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"

View File

@ -28,10 +28,8 @@
#include <string>
#include <vector>
extern "C" {
#include "BLI_path_util.h"
#include "BLI_string.h"
}
using namespace std;

View File

@ -24,12 +24,12 @@
#ifndef __GPU_FRAMEBUFFER_H__
#define __GPU_FRAMEBUFFER_H__
#include "GPU_texture.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "GPU_texture.h"
typedef struct GPUAttachment {
struct GPUTexture *tex;
int mip, layer;

View File

@ -24,12 +24,9 @@
#ifndef __GPU_TEXTURE_H__
#define __GPU_TEXTURE_H__
#include "BLI_utildefines.h"
#include "GPU_state.h"
#ifdef __cplusplus
extern "C" {
#endif
struct GPUVertBuf;
struct ImBuf;
struct Image;
@ -60,6 +57,12 @@ typedef enum eGPUSamplerState {
GPU_SAMPLER_MAX = (1 << 8),
} eGPUSamplerState;
ENUM_OPERATORS(eGPUSamplerState)
#ifdef __cplusplus
extern "C" {
#endif
#define GPU_SAMPLER_DEFAULT GPU_SAMPLER_FILTER
#define GPU_SAMPLER_REPEAT (GPU_SAMPLER_REPEAT_S | GPU_SAMPLER_REPEAT_T | GPU_SAMPLER_REPEAT_R)

View File

@ -20,9 +20,7 @@
#include "testing/testing.h"
extern "C" {
#include "BLI_utildefines.h"
}
namespace blender::io {

View File

@ -29,6 +29,10 @@
struct SDNA;
#ifdef __cplusplus
extern "C" {
#endif
/**
* DNAstr contains the prebuilt SDNA structure defining the layouts of the types
* used by this version of Blender. It is defined in a file dna.c, which is
@ -134,4 +138,8 @@ bool DNA_struct_alias_elem_find(const struct SDNA *sdna,
const char *name);
void DNA_sdna_alias_data_ensure_structs_map(struct SDNA *sdna);
#ifdef __cplusplus
}
#endif
#endif /* __DNA_GENFILE_H__ */

View File

@ -21,6 +21,10 @@
#ifndef __BPY_H__
#define __BPY_H__
#ifdef __cplusplus
extern "C" {
#endif
void BPy_init_modules(void);
extern PyObject *bpy_package_py;
@ -31,4 +35,8 @@ void BPY_atexit_unregister(void);
extern struct CLG_LogRef *BPY_LOG_CONTEXT;
extern struct CLG_LogRef *BPY_LOG_RNA;
#ifdef __cplusplus
}
#endif
#endif /* __BPY_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_APP_H__
#define __BPY_APP_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_struct(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_H__ */

View File

@ -24,6 +24,14 @@
#ifndef __BPY_APP_ALEMBIC_H__
#define __BPY_APP_ALEMBIC_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_alembic_struct(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_ALEMBIC_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_APP_BUILD_OPTIONS_H__
#define __BPY_APP_BUILD_OPTIONS_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_build_options_struct(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_BUILD_OPTIONS_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_APP_FFMPEG_H__
#define __BPY_APP_FFMPEG_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_ffmpeg_struct(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_FFMPEG_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_APP_HANDLERS_H__
#define __BPY_APP_HANDLERS_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_handlers_struct(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_HANDLERS_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_APP_ICONS_H__
#define __BPY_APP_ICONS_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_icons_module(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_ICONS_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_APP_OCIO_H__
#define __BPY_APP_OCIO_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_ocio_struct(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_OCIO_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_APP_OIIO_H__
#define __BPY_APP_OIIO_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_oiio_struct(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_OIIO_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_APP_OPENSUBDIV_H__
#define __BPY_APP_OPENSUBDIV_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_opensubdiv_struct(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_OPENSUBDIV_H__ */

View File

@ -24,6 +24,14 @@
#ifndef __BPY_APP_OPENVDB_H__
#define __BPY_APP_OPENVDB_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_openvdb_struct(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_OPENVDB_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_APP_SDL_H__
#define __BPY_APP_SDL_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_sdl_struct(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_SDL_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_APP_TIMERS_H__
#define __BPY_APP_TIMERS_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_timers_module(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_TIMERS_H__ */

View File

@ -21,7 +21,15 @@
#ifndef __BPY_APP_TRANSLATIONS_H__
#define __BPY_APP_TRANSLATIONS_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_translations_struct(void);
void BPY_app_translations_end(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_TRANSLATIONS_H__ */

View File

@ -24,6 +24,14 @@
#ifndef __BPY_APP_USD_H__
#define __BPY_APP_USD_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_app_usd_struct(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_APP_USD_H__ */

View File

@ -25,6 +25,10 @@
# error "Python 3.7 or greater is required, you'll need to update your Python."
#endif
#ifdef __cplusplus
extern "C" {
#endif
struct EnumPropertyItem;
struct ReportList;
@ -50,4 +54,8 @@ void BPy_SetContext(struct bContext *C);
extern void bpy_context_set(struct bContext *C, PyGILState_STATE *gilstate);
extern void bpy_context_clear(struct bContext *C, const PyGILState_STATE *gilstate);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_CAPI_UTILS_H__ */

View File

@ -21,7 +21,15 @@
#ifndef __BPY_DRIVER_H__
#define __BPY_DRIVER_H__
#ifdef __cplusplus
extern "C" {
#endif
int bpy_pydriver_create_dict(void);
extern PyObject *bpy_pydriver_Dict;
#ifdef __cplusplus
}
#endif
#endif /* __BPY_DRIVER_H__ */

View File

@ -24,8 +24,16 @@
struct wmGizmoGroupType;
struct wmGizmoType;
#ifdef __cplusplus
extern "C" {
#endif
/* exposed to rna/wm api */
void BPY_RNA_gizmo_wrapper(struct wmGizmoType *gzt, void *userdata);
void BPY_RNA_gizmogroup_wrapper(struct wmGizmoGroupType *gzgt, void *userdata);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_GIZMO_WRAP_H__ */

View File

@ -21,6 +21,10 @@
* \ingroup pythonintern
*/
#ifdef __cplusplus
extern "C" {
#endif
void bpy_intern_string_init(void);
void bpy_intern_string_exit(void);
@ -41,4 +45,8 @@ extern PyObject *bpy_intern_str_register;
extern PyObject *bpy_intern_str_self;
extern PyObject *bpy_intern_str_unregister;
#ifdef __cplusplus
}
#endif
#endif /* __BPY_INTERN_STRING_H__ */

View File

@ -21,9 +21,17 @@
#ifndef __BPY_LIBRARY_H__
#define __BPY_LIBRARY_H__
#ifdef __cplusplus
extern "C" {
#endif
int BPY_library_load_type_ready(void);
extern PyMethodDef BPY_library_load_method_def;
extern PyMethodDef BPY_library_write_method_def;
#ifdef __cplusplus
}
#endif
#endif /* __BPY_LIBRARY_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_MSGBUS_H__
#define __BPY_MSGBUS_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_msgbus_module(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_MSGBUS_H__ */

View File

@ -21,6 +21,10 @@
#ifndef __BPY_OPERATOR_H__
#define __BPY_OPERATOR_H__
#ifdef __cplusplus
extern "C" {
#endif
extern PyTypeObject pyop_base_Type;
#define BPy_OperatorBase_Check(v) (PyObject_TypeCheck(v, &pyop_base_Type))
@ -31,4 +35,8 @@ typedef struct {
PyObject *BPY_operator_module(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -23,6 +23,10 @@
struct wmOperatorType;
#ifdef __cplusplus
extern "C" {
#endif
/* these are used for operator methods, used by bpy_operator.c */
PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args);
@ -30,4 +34,8 @@ PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args);
void BPY_RNA_operator_wrapper(struct wmOperatorType *ot, void *userdata);
void BPY_RNA_operator_macro_wrapper(struct wmOperatorType *ot, void *userdata);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -21,6 +21,14 @@
#ifndef __BPY_PATH_H__
#define __BPY_PATH_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPyInit__bpy_path(void);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -21,6 +21,10 @@
#ifndef __BPY_PROPS_H__
#define __BPY_PROPS_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_rna_props(void);
PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw);
@ -29,4 +33,8 @@ StructRNA *pointer_type_from_py(PyObject *value, const char *error_prefix);
#define PYRNA_STACK_ARRAY RNA_STACK_ARRAY
#ifdef __cplusplus
}
#endif
#endif

View File

@ -67,6 +67,10 @@
struct ID;
#ifdef __cplusplus
extern "C" {
#endif
extern PyTypeObject pyrna_struct_meta_idprop_Type;
extern PyTypeObject pyrna_struct_Type;
extern PyTypeObject pyrna_prop_Type;
@ -265,4 +269,8 @@ extern PyMethodDef meth_bpy_owner_id_get;
extern BPy_StructRNA *bpy_context_module;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -21,6 +21,10 @@
* \ingroup pythonintern
*/
#ifdef __cplusplus
extern "C" {
#endif
extern char pyrna_struct_keyframe_insert_doc[];
extern char pyrna_struct_keyframe_delete_doc[];
extern char pyrna_struct_driver_add_doc[];
@ -31,4 +35,8 @@ PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyOb
PyObject *pyrna_struct_driver_add(BPy_StructRNA *self, PyObject *args);
PyObject *pyrna_struct_driver_remove(BPy_StructRNA *self, PyObject *args);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_RNA_ANIM_H__ */

View File

@ -24,6 +24,10 @@
struct BPy_StructRNA;
struct PyObject;
#ifdef __cplusplus
extern "C" {
#endif
#if 0
PyObject *pyrna_callback_add(BPy_StructRNA *self, PyObject *args);
PyObject *pyrna_callback_remove(BPy_StructRNA *self, PyObject *args);
@ -32,4 +36,8 @@ PyObject *pyrna_callback_remove(BPy_StructRNA *self, PyObject *args);
PyObject *pyrna_callback_classmethod_add(PyObject *cls, PyObject *args);
PyObject *pyrna_callback_classmethod_remove(PyObject *cls, PyObject *args);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_RNA_CALLBACK_H__ */

View File

@ -25,10 +25,18 @@ struct ChannelDriver;
struct DriverTarget;
struct PathResolvedRNA;
#ifdef __cplusplus
extern "C" {
#endif
PyObject *pyrna_driver_get_variable_value(struct ChannelDriver *driver, struct DriverTarget *dtar);
PyObject *pyrna_driver_self_from_anim_rna(struct PathResolvedRNA *anim_rna);
bool pyrna_driver_is_equal_anim_rna(const struct PathResolvedRNA *anim_rna,
const PyObject *py_anim_rna);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_RNA_DRIVER_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_RNA_GIZMO_H__
#define __BPY_RNA_GIZMO_H__
#ifdef __cplusplus
extern "C" {
#endif
int BPY_rna_gizmo_module(PyObject *);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_RNA_GIZMO_H__ */

View File

@ -21,8 +21,16 @@
#ifndef __BPY_RNA_ID_COLLECTION_H__
#define __BPY_RNA_ID_COLLECTION_H__
#ifdef __cplusplus
extern "C" {
#endif
extern PyMethodDef BPY_rna_id_collection_user_map_method_def;
extern PyMethodDef BPY_rna_id_collection_batch_remove_method_def;
extern PyMethodDef BPY_rna_id_collection_orphans_purge_method_def;
#ifdef __cplusplus
}
#endif
#endif /* __BPY_RNA_ID_COLLECTION_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_RNA_TYPES_CAPI_H__
#define __BPY_RNA_TYPES_CAPI_H__
#ifdef __cplusplus
extern "C" {
#endif
void BPY_rna_types_extend_capi(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_RNA_TYPES_CAPI_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_TRACEBACK_H__
#define __BPY_TRACEBACK_H__
#ifdef __cplusplus
extern "C" {
#endif
void python_script_error_jump(const char *filepath, int *lineno, int *offset);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_TRACEBACK_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_UTILS_PREVIEWS_H__
#define __BPY_UTILS_PREVIEWS_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_utils_previews_module(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_UTILS_PREVIEWS_H__ */

View File

@ -21,6 +21,14 @@
#ifndef __BPY_UTILS_UNITS_H__
#define __BPY_UTILS_UNITS_H__
#ifdef __cplusplus
extern "C" {
#endif
PyObject *BPY_utils_units(void);
#ifdef __cplusplus
}
#endif
#endif /* __BPY_UTILS_UNITS_H__ */

View File

@ -29,6 +29,10 @@ struct ImBuf;
struct Mesh;
struct Render;
#ifdef __cplusplus
extern "C" {
#endif
typedef struct BakeImage {
struct Image *image;
int width;
@ -120,4 +124,8 @@ void RE_bake_normal_world_to_world(const BakePixel pixel_array[],
void RE_bake_ibuf_clear(struct Image *image, const bool is_tangent);
#ifdef __cplusplus
}
#endif
#endif /* __RE_BAKE_H__ */

View File

@ -48,6 +48,10 @@ struct ViewLayer;
struct bNode;
struct bNodeTree;
#ifdef __cplusplus
extern "C" {
#endif
/* External Engine */
/* RenderEngineType.flag */
@ -237,4 +241,8 @@ void RE_bake_engine_set_engine_parameters(struct Render *re,
void RE_engine_free_blender_memory(struct RenderEngine *engine);
#ifdef __cplusplus
}
#endif
#endif /* __RE_ENGINE_H__ */

View File

@ -27,6 +27,10 @@
struct MultiresBakeRender;
struct Scene;
#ifdef __cplusplus
extern "C" {
#endif
typedef struct MultiresBakeRender {
Scene *scene;
DerivedMesh *lores_dm, *hires_dm;
@ -63,4 +67,8 @@ typedef struct MultiresBakeRender {
void RE_multires_bake_images(struct MultiresBakeRender *bkr);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -32,6 +32,10 @@ struct Depsgraph;
struct ImagePool;
struct MTex;
#ifdef __cplusplus
extern "C" {
#endif
/* render_texture.c */
bool RE_texture_evaluate(const struct MTex *mtex,
const float vec[3],
@ -72,4 +76,8 @@ void RE_point_density_free(struct PointDensity *pd);
void RE_point_density_fix_linking(void);
#ifdef __cplusplus
}
#endif
#endif /* __RE_RENDER_EXT_H__ */

View File

@ -24,10 +24,18 @@
#ifndef __INITRENDER_H__
#define __INITRENDER_H__
#ifdef __cplusplus
extern "C" {
#endif
/* Functions */
void RE_parts_init(Render *re);
void RE_parts_free(Render *re);
void RE_parts_clamp(Render *re);
#ifdef __cplusplus
}
#endif
#endif /* __INITRENDER_H__ */

View File

@ -44,6 +44,10 @@ struct RenderResult;
struct Scene;
struct rcti;
#ifdef __cplusplus
extern "C" {
#endif
/* New */
struct RenderResult *render_result_new(struct Render *re,
@ -148,4 +152,8 @@ bool render_result_has_views(struct RenderResult *rr);
} \
((void)0)
#ifdef __cplusplus
}
#endif
#endif /* __RENDER_RESULT_H__ */

View File

@ -43,6 +43,10 @@ struct Object;
struct RenderEngine;
struct ReportList;
#ifdef __cplusplus
extern "C" {
#endif
/* this is handed over to threaded hiding/passes/shading engine */
typedef struct RenderPart {
struct RenderPart *next, *prev;
@ -160,4 +164,8 @@ struct Render {
/* R.flag */
#define R_ANIMATION 1
#ifdef __cplusplus
}
#endif
#endif /* __RENDER_TYPES_H__ */

View File

@ -30,10 +30,18 @@ struct RenderData;
struct RenderLayer;
struct RenderResult;
#ifdef __cplusplus
extern "C" {
#endif
struct RenderLayer *render_get_active_layer(struct Render *re, struct RenderResult *rr);
void render_update_anim_renderdata(struct Render *re,
struct RenderData *rd,
struct ListBase *render_layers);
void render_copy_renderdata(struct RenderData *to, struct RenderData *from);
#ifdef __cplusplus
}
#endif
#endif /* __RENDERPIPELINE_H__ */

View File

@ -24,6 +24,10 @@
#ifndef __TEXTURE_H__
#define __TEXTURE_H__
#ifdef __cplusplus
extern "C" {
#endif
#define BRICONT \
texres->tin = (texres->tin - 0.5f) * tex->contrast + tex->bright - 0.5f; \
if (!(tex->flag & TEX_NO_CLAMP)) { \
@ -95,4 +99,8 @@ void image_sample(struct Image *ima,
float result[4],
struct ImagePool *pool);
#ifdef __cplusplus
}
#endif
#endif /* __TEXTURE_H__ */

View File

@ -21,6 +21,10 @@
#ifndef __ZBUF_H__
#define __ZBUF_H__
#ifdef __cplusplus
extern "C" {
#endif
/* span fill in method, is also used to localize data for zbuffering */
typedef struct ZSpan {
int rectx, recty; /* range for clipping */
@ -40,4 +44,8 @@ void zspan_scanconvert(struct ZSpan *zpan,
float *v3,
void (*func)(void *, int, int, float, float));
#ifdef __cplusplus
}
#endif
#endif

View File

@ -52,6 +52,10 @@ struct wmWindowManager;
#include "wm_gizmo_fn.h"
#ifdef __cplusplus
extern "C" {
#endif
/* -------------------------------------------------------------------- */
/* wmGizmo */
@ -396,4 +400,8 @@ void WM_gizmo_group_tag_remove(struct wmGizmoGroup *gzgroup);
bool WM_gizmo_group_type_poll(const struct bContext *C, const struct wmGizmoGroupType *gzgt);
void WM_gizmo_group_refresh(const struct bContext *C, struct wmGizmoGroup *gzgroup);
#ifdef __cplusplus
}
#endif
#endif /* __WM_GIZMO_API_H__ */

View File

@ -40,6 +40,10 @@ struct wmKeyConfig;
#include "DNA_listBase.h"
#ifdef __cplusplus
extern "C" {
#endif
/* -------------------------------------------------------------------- */
/* Enum Typedef's */
@ -506,4 +510,8 @@ typedef enum eWM_GizmoFlagMapDrawStep {
} eWM_GizmoFlagMapDrawStep;
#define WM_GIZMOMAP_DRAWSTEP_MAX 2
#ifdef __cplusplus
}
#endif
#endif /* __WM_GIZMO_TYPES_H__ */

View File

@ -27,6 +27,10 @@
struct wmMsgBus;
#ifdef __cplusplus
extern "C" {
#endif
/* wmGizmoGroup */
typedef bool (*wmGizmoGroupFnPoll)(const struct bContext *,
struct wmGizmoGroupType *) ATTR_WARN_UNUSED_RESULT;
@ -85,4 +89,8 @@ typedef struct wmGizmoPropertyFnParams {
void *user_data;
} wmGizmoPropertyFnParams;
#ifdef __cplusplus
}
#endif
#endif /* __WM_GIZMO_FN_H__ */

View File

@ -36,6 +36,10 @@ struct wmEventHandler_Op;
struct wmGizmoMap;
struct wmOperatorType;
#ifdef __cplusplus
extern "C" {
#endif
/* -------------------------------------------------------------------- */
/* wmGizmo */
@ -92,4 +96,8 @@ struct ListBase *wm_gizmomap_groups_get(wmGizmoMap *gzmap);
void wm_gizmomaptypes_free(void);
#ifdef __cplusplus
}
#endif
#endif /* __WM_GIZMO_WMAPI_H__ */

View File

@ -34,6 +34,10 @@ struct wmMsgSubscribeKey;
struct wmMsgSubscribeValue;
struct wmMsgSubscribeValueLink;
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*wmMsgNotifyFn)(struct bContext *C,
struct wmMsgSubscribeKey *msg_key,
struct wmMsgSubscribeValue *msg_val);
@ -287,4 +291,8 @@ void WM_msg_publish_ID(struct wmMsgBus *mbus, struct ID *id);
} \
((void)0)
#ifdef __cplusplus
}
#endif
#endif /* __WM_MESSAGE_BUS_H__ */

View File

@ -30,6 +30,10 @@ struct wmWindow;
#include "gizmo/wm_gizmo_wmapi.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct wmPaintCursor {
struct wmPaintCursor *next, *prev;
@ -97,4 +101,8 @@ void wm_stereo3d_set_cancel(bContext *C, wmOperator *op);
void wm_open_init_load_ui(wmOperator *op, bool use_prefs);
void wm_open_init_use_scripts(wmOperator *op, bool use_prefs);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -27,6 +27,10 @@
struct wmEvent;
struct wmWindow;
#ifdef __cplusplus
extern "C" {
#endif
typedef enum WMCursorType {
WM_CURSOR_DEFAULT = 1,
WM_CURSOR_TEXT_EDIT,
@ -77,4 +81,8 @@ typedef enum WMCursorType {
void wm_init_cursor_data(void);
bool wm_cursor_arrow_move(struct wmWindow *win, const struct wmEvent *event);
#ifdef __cplusplus
}
#endif
#endif /* __WM_CURSORS_H__ */

View File

@ -30,6 +30,10 @@ struct GPUOffScreen;
struct GPUTexture;
struct GPUViewport;
#ifdef __cplusplus
extern "C" {
#endif
typedef struct wmDrawBuffer {
struct GPUOffScreen *offscreen;
struct GPUViewport *viewport;
@ -50,4 +54,8 @@ void wm_draw_region_test(struct bContext *C, struct ScrArea *area, struct ARegio
struct GPUTexture *wm_draw_region_texture(struct ARegion *region, int view);
#ifdef __cplusplus
}
#endif
#endif /* __WM_DRAW_H__ */

View File

@ -34,6 +34,10 @@ struct ARegion;
struct GHOST_TabletData;
struct ScrArea;
#ifdef __cplusplus
extern "C" {
#endif
/* wmKeyMap is in DNA_windowmanager.h, it's saveable */
/** Custom types for handlers, for signaling, freeing */
@ -165,4 +169,8 @@ void wm_dropbox_free(void);
void wm_drags_check_ops(bContext *C, const wmEvent *event);
void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect);
#ifdef __cplusplus
}
#endif
#endif /* __WM_EVENT_SYSTEM_H__ */

View File

@ -26,6 +26,10 @@
#ifndef __WM_EVENT_TYPES_H__
#define __WM_EVENT_TYPES_H__
#ifdef __cplusplus
extern "C" {
#endif
/* customdata type */
enum {
EVT_DATA_TIMER = 2,
@ -489,4 +493,8 @@ enum {
GESTURE_MODAL_CIRCLE_SIZE = 11,
};
#ifdef __cplusplus
}
#endif
#endif /* __WM_EVENT_TYPES_H__ */

View File

@ -28,6 +28,10 @@ struct Main;
struct wmGenericCallback;
struct wmOperatorType;
#ifdef __cplusplus
extern "C" {
#endif
/* wm_files.c */
void wm_history_file_read(void);
void wm_homefile_read(struct bContext *C,
@ -68,4 +72,8 @@ void WM_OT_append(struct wmOperatorType *ot);
void WM_OT_lib_relocate(struct wmOperatorType *ot);
void WM_OT_lib_reload(struct wmOperatorType *ot);
#ifdef __cplusplus
}
#endif
#endif /* __WM_FILES_H__ */

View File

@ -27,6 +27,10 @@
struct bContext;
#ifdef __cplusplus
extern "C" {
#endif
typedef struct wmSurface {
struct wmSurface *next, *prev;
@ -59,4 +63,8 @@ void wm_surface_clear_drawable(void);
void wm_surface_set_drawable(wmSurface *surface, bool activate);
void wm_surface_reset_drawable(void);
#ifdef __cplusplus
}
#endif
#endif /* __WM_SURFACE_H__ */

View File

@ -26,6 +26,10 @@
struct wmOperator;
#ifdef __cplusplus
extern "C" {
#endif
/* *************** internal api ************** */
void wm_ghost_init(bContext *C);
void wm_ghost_exit(void);
@ -85,4 +89,8 @@ int wm_window_new_main_exec(bContext *C, struct wmOperator *op);
void wm_test_autorun_warning(bContext *C);
#ifdef __cplusplus
}
#endif
#endif /* __WM_WINDOW_H__ */

View File

@ -4,13 +4,11 @@
#include "exporter/abc_archive.h"
#include "intern/abc_util.h"
extern "C" {
#include "BKE_main.h"
#include "BLI_fileops.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "DNA_scene_types.h"
}
#include "DEG_depsgraph.h"

View File

@ -3,10 +3,8 @@
// Keep first since utildefines defines AT which conflicts with STL
#include "intern/abc_axis_conversion.h"
extern "C" {
#include "BLI_math.h"
#include "BLI_utildefines.h"
}
namespace blender {
namespace io {

View File

@ -4,7 +4,6 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BLI_array_store.h"
#include "BLI_array_utils.h"
#include "BLI_listbase.h"
@ -13,7 +12,6 @@ extern "C" {
#include "BLI_string.h"
#include "BLI_sys_types.h"
#include "BLI_utildefines.h"
}
/* print memory savings */
// #define DEBUG_PRINT

View File

@ -2,11 +2,9 @@
#include "testing/testing.h"
extern "C" {
#include "BLI_array_utils.h"
#include "BLI_utildefines.h"
#include "BLI_utildefines_stack.h"
}
/* -------------------------------------------------------------------- */
/* tests */

View File

@ -4,13 +4,11 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BLI_math.h"
#include "BLI_rand.h"
#include "PIL_time.h"
#include "BLI_delaunay_2d.h"
}
#include <fstream>
#include <iostream>

View File

@ -4,10 +4,8 @@
#include <string.h>
extern "C" {
#include "BLI_expr_pylike_eval.h"
#include "BLI_math.h"
};
#define TRUE_VAL 1.0
#define FALSE_VAL 0.0

View File

@ -7,13 +7,11 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BLI_ghash.h"
#include "BLI_rand.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "PIL_time_utildefines.h"
}
/* Using http://corpora.uni-leipzig.de/downloads/eng_wikipedia_2010_1M-text.tar.gz
* (1 million of words, about 122MB of text) from

View File

@ -4,11 +4,9 @@
#define GHASH_INTERNAL_API
extern "C" {
#include "BLI_ghash.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
}
#define TESTCASE_SIZE 10000

View File

@ -2,9 +2,7 @@
#include "testing/testing.h"
extern "C" {
#include "BLI_hash_mm2a.h"
}
/* Note: Reference results are taken from reference implementation
* (cpp code, CMurmurHash2A variant):

View File

@ -5,13 +5,11 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BLI_compiler_attrs.h"
#include "BLI_heap_simple.h"
#include "BLI_rand.h"
#include "BLI_sys_types.h"
#include "BLI_utildefines.h"
};
#define SIZE 1024

View File

@ -5,12 +5,10 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BLI_compiler_attrs.h"
#include "BLI_heap.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
};
#define SIZE 1024

View File

@ -6,12 +6,10 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BLI_compiler_attrs.h"
#include "BLI_kdopbvh.h"
#include "BLI_math_vector.h"
#include "BLI_rand.h"
}
#include "stubs/bf_intern_eigen_stubs.h"

View File

@ -4,13 +4,11 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BLI_array_utils.h"
#include "BLI_listbase.h"
#include "BLI_path_util.h"
#include "BLI_ressource_strings.h"
#include "BLI_string.h"
}
/* local validation function */
static bool listbase_is_valid(const ListBase *listbase)

View File

@ -4,13 +4,11 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BLI_array_utils.h"
#include "BLI_memiter.h"
#include "BLI_ressource_strings.h"
#include "BLI_string.h"
}
TEST(memiter, Nop)
{

View File

@ -2,7 +2,6 @@
#include "testing/testing.h"
extern "C" {
#include "../../../source/blender/imbuf/IMB_imbuf.h"
#include "BLI_fileops.h"
#include "BLI_path_util.h"
@ -11,7 +10,6 @@ extern "C" {
#ifdef _WIN32
# include "../../../source/blender/blenkernel/BKE_global.h"
#endif
}
/* -------------------------------------------------------------------- */
/* stubs */

View File

@ -11,7 +11,6 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BLI_array_utils.h"
#include "BLI_edgehash.h"
#include "BLI_math.h"
@ -27,7 +26,6 @@ extern "C" {
# include "BLI_memarena.h"
# include "BLI_polyfill_2d_beautify.h"
#endif
}
#include "stubs/bf_intern_eigen_stubs.h"

View File

@ -3,11 +3,9 @@
#include "testing/testing.h"
#include <string.h>
extern "C" {
#include "BLI_array.h"
#include "BLI_stack.h"
#include "BLI_utildefines.h"
};
#define SIZE 1024

View File

@ -9,12 +9,10 @@
#include <utility>
#include <vector>
extern "C" {
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
}
using std::initializer_list;
using std::pair;

View File

@ -2,11 +2,9 @@
#include "testing/testing.h"
extern "C" {
#include "BLI_string.h"
#include "BLI_string_utf8.h"
#include "BLI_utildefines.h"
}
/* Note that 'common' utf-8 variants of string functions (like copy, etc.) are tested in
* BLI_string_test.cc However, tests below are specific utf-8 conformance ones, and since they eat

View File

@ -9,7 +9,6 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BLI_utildefines.h"
#include "BLI_listbase.h"
@ -17,7 +16,6 @@ extern "C" {
#include "BLI_task.h"
#include "PIL_time.h"
}
#define NUM_RUN_AVERAGED 100

View File

@ -7,13 +7,11 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BLI_utildefines.h"
#include "BLI_listbase.h"
#include "BLI_mempool.h"
#include "BLI_task.h"
};
#define NUM_ITEMS 10000

View File

@ -19,7 +19,6 @@
#include "MEM_guardedalloc.h"
extern "C" {
#include "BKE_appdir.h"
#include "BKE_blender.h"
#include "BKE_context.h"
@ -48,7 +47,6 @@ extern "C" {
#include "WM_api.h"
#include "wm.h"
}
BlendfileLoadingBaseTest::~BlendfileLoadingBaseTest()
{

View File

@ -2,9 +2,7 @@
#include "testing/testing.h"
extern "C" {
#include "BLI_utildefines.h"
}
#include "MEM_guardedalloc.h"