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:
2020-07-28 16:32:30 +02:00
parent 9c1da81a4c
commit b274d18aec
94 changed files with 483 additions and 72 deletions

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__ */