[Bf-blender-cvs] [cf93b65a65f] master: Cleanup: make remaining blenlib headers work in C++

Jacques Lucke noreply at git.blender.org
Mon Mar 2 15:05:31 CET 2020


Commit: cf93b65a65f948d4014d3fd2f7541ffe1b2209d4
Author: Jacques Lucke
Date:   Mon Mar 2 15:04:53 2020 +0100
Branches: master
https://developer.blender.org/rBcf93b65a65f948d4014d3fd2f7541ffe1b2209d4

Cleanup: make remaining blenlib headers work in C++

Differential Revision: https://developer.blender.org/D6988

Reviewers: brecht

===================================================================

M	source/blender/blenlib/BLI_args.h
M	source/blender/blenlib/BLI_array_store.h
M	source/blender/blenlib/BLI_array_store_utils.h
M	source/blender/blenlib/BLI_array_utils.h
M	source/blender/blenlib/BLI_astar.h
M	source/blender/blenlib/BLI_bitmap.h
M	source/blender/blenlib/BLI_bitmap_draw_2d.h
M	source/blender/blenlib/BLI_boxpack_2d.h
M	source/blender/blenlib/BLI_buffer.h
M	source/blender/blenlib/BLI_convexhull_2d.h
M	source/blender/blenlib/BLI_delaunay_2d.h
M	source/blender/blenlib/BLI_dial_2d.h
M	source/blender/blenlib/BLI_dlrbTree.h
M	source/blender/blenlib/BLI_dynlib.h
M	source/blender/blenlib/BLI_dynstr.h
M	source/blender/blenlib/BLI_edgehash.h
M	source/blender/blenlib/BLI_endian_switch.h
M	source/blender/blenlib/BLI_endian_switch_inline.h
M	source/blender/blenlib/BLI_fileops_types.h
M	source/blender/blenlib/BLI_hash_md5.h
M	source/blender/blenlib/BLI_hash_mm2a.h
M	source/blender/blenlib/BLI_heap.h
M	source/blender/blenlib/BLI_heap_simple.h
M	source/blender/blenlib/BLI_iterator.h
M	source/blender/blenlib/BLI_jitter_2d.h
M	source/blender/blenlib/BLI_lasso_2d.h
M	source/blender/blenlib/BLI_linklist.h
M	source/blender/blenlib/BLI_math_interp.h
M	source/blender/blenlib/BLI_memory_utils.h
M	source/blender/blenlib/BLI_polyfill_2d.h
M	source/blender/blenlib/BLI_polyfill_2d_beautify.h
M	source/blender/blenlib/BLI_quadric.h
M	source/blender/blenlib/BLI_smallhash.h
M	source/blender/blenlib/BLI_sort_utils.h
M	source/blender/blenlib/BLI_string_cursor_utf8.h
M	source/blender/blenlib/BLI_timecode.h
M	source/blender/blenlib/BLI_timer.h
M	source/blender/blenlib/BLI_uvproject.h
M	source/blender/blenlib/BLI_vfontdata.h
M	source/blender/blenlib/BLI_voronoi_2d.h
M	source/blender/blenlib/BLI_voxel.h

===================================================================

diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h
index 0e4ca61e81a..9031cd2ba2f 100644
--- a/source/blender/blenlib/BLI_args.h
+++ b/source/blender/blenlib/BLI_args.h
@@ -25,6 +25,10 @@
  * \brief A general argument parsing module.
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct bArgs;
 typedef struct bArgs bArgs;
 
@@ -71,4 +75,8 @@ void BLI_argsPrintOtherDoc(struct bArgs *ba);
 void BLI_argsPrint(struct bArgs *ba);
 const char **BLI_argsArgv(struct bArgs *ba);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/source/blender/blenlib/BLI_array_store.h b/source/blender/blenlib/BLI_array_store.h
index 1dc4a504884..a8a7dde63b5 100644
--- a/source/blender/blenlib/BLI_array_store.h
+++ b/source/blender/blenlib/BLI_array_store.h
@@ -22,6 +22,10 @@
  * \brief Efficient in-memory storage of multiple similar arrays.
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct BArrayState BArrayState;
 typedef struct BArrayStore BArrayStore;
 
@@ -46,4 +50,8 @@ void *BLI_array_store_state_data_get_alloc(BArrayState *state, size_t *r_data_le
 /* only for tests */
 bool BLI_array_store_is_valid(BArrayStore *bs);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_ARRAY_STORE_H__ */
diff --git a/source/blender/blenlib/BLI_array_store_utils.h b/source/blender/blenlib/BLI_array_store_utils.h
index ff6caddffd5..5b5263bf8a4 100644
--- a/source/blender/blenlib/BLI_array_store_utils.h
+++ b/source/blender/blenlib/BLI_array_store_utils.h
@@ -21,6 +21,10 @@
  * \ingroup bli
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct BArrayStore;
 
 struct BArrayStore_AtSize {
@@ -40,4 +44,8 @@ void BLI_array_store_at_size_calc_memory_usage(struct BArrayStore_AtSize *bs_str
                                                size_t *r_size_expanded,
                                                size_t *r_size_compacted);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_ARRAY_STORE_UTILS_H__ */
diff --git a/source/blender/blenlib/BLI_array_utils.h b/source/blender/blenlib/BLI_array_utils.h
index 4ceb149f238..f70aa3b54fa 100644
--- a/source/blender/blenlib/BLI_array_utils.h
+++ b/source/blender/blenlib/BLI_array_utils.h
@@ -24,6 +24,10 @@
 
 #include "BLI_compiler_typecheck.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void _bli_array_reverse(void *arr, unsigned int arr_len, size_t arr_stride);
 #define BLI_array_reverse(arr, arr_len) _bli_array_reverse(arr, arr_len, sizeof(*(arr)))
 
@@ -85,4 +89,8 @@ bool _bli_array_iter_span(const void *arr,
 bool _bli_array_is_zeroed(const void *arr, unsigned int arr_len, size_t arr_stride);
 #define BLI_array_is_zeroed(arr, arr_len) _bli_array_is_zeroed(arr, arr_len, sizeof(*(arr)))
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_ARRAY_UTILS_H__ */
diff --git a/source/blender/blenlib/BLI_astar.h b/source/blender/blenlib/BLI_astar.h
index 3fe37d7886b..8a70371cbcb 100644
--- a/source/blender/blenlib/BLI_astar.h
+++ b/source/blender/blenlib/BLI_astar.h
@@ -29,6 +29,10 @@
 
 #include "BLI_bitmap.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* -------------------------------------------------------------------- */
 
 typedef struct BLI_AStarGNLink {
@@ -114,4 +118,8 @@ bool BLI_astar_graph_solve(BLI_AStarGraph *as_graph,
                            BLI_AStarSolution *r_solution,
                            const int max_steps);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_ASTAR_H__ */
diff --git a/source/blender/blenlib/BLI_bitmap.h b/source/blender/blenlib/BLI_bitmap.h
index 3af25e3de1d..3772a063515 100644
--- a/source/blender/blenlib/BLI_bitmap.h
+++ b/source/blender/blenlib/BLI_bitmap.h
@@ -24,6 +24,10 @@
  * \ingroup bli
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef unsigned int BLI_bitmap;
 
 /* warning: the bitmap does not keep track of its own size or check
@@ -109,4 +113,8 @@ void BLI_bitmap_copy_all(BLI_bitmap *dst, const BLI_bitmap *src, size_t bits);
 void BLI_bitmap_and_all(BLI_bitmap *dst, const BLI_bitmap *src, size_t bits);
 void BLI_bitmap_or_all(BLI_bitmap *dst, const BLI_bitmap *src, size_t bits);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
diff --git a/source/blender/blenlib/BLI_bitmap_draw_2d.h b/source/blender/blenlib/BLI_bitmap_draw_2d.h
index bad1605ac5d..f5f8b28b27f 100644
--- a/source/blender/blenlib/BLI_bitmap_draw_2d.h
+++ b/source/blender/blenlib/BLI_bitmap_draw_2d.h
@@ -21,6 +21,10 @@
  * \ingroup bli
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void BLI_bitmap_draw_2d_line_v2v2i(const int p1[2],
                                    const int p2[2],
                                    bool (*callback)(int, int, void *),
@@ -41,4 +45,8 @@ void BLI_bitmap_draw_2d_poly_v2i_n(const int xmin,
                                    void (*callback)(int x, int x_end, int y, void *),
                                    void *user_data);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_BITMAP_DRAW_2D_H__ */
diff --git a/source/blender/blenlib/BLI_boxpack_2d.h b/source/blender/blenlib/BLI_boxpack_2d.h
index b519a920a77..762cb7aaa44 100644
--- a/source/blender/blenlib/BLI_boxpack_2d.h
+++ b/source/blender/blenlib/BLI_boxpack_2d.h
@@ -24,6 +24,10 @@
  * \ingroup bli
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct ListBase;
 
 /* Box Packer */
@@ -57,4 +61,8 @@ void BLI_box_pack_2d_fixedarea(struct ListBase *boxes,
                                int height,
                                struct ListBase *packed);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_BOXPACK_2D_H__ */
diff --git a/source/blender/blenlib/BLI_buffer.h b/source/blender/blenlib/BLI_buffer.h
index 22d21262712..d81446af14b 100644
--- a/source/blender/blenlib/BLI_buffer.h
+++ b/source/blender/blenlib/BLI_buffer.h
@@ -21,6 +21,10 @@
  * \ingroup bli
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct BLI_Buffer {
   void *data;
   const size_t elem_size;
@@ -93,4 +97,8 @@ void _bli_buffer_free(BLI_Buffer *buffer);
 
 #define BLI_buffer_field_free(name_) _bli_buffer_free(name_)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_BUFFER_H__ */
diff --git a/source/blender/blenlib/BLI_convexhull_2d.h b/source/blender/blenlib/BLI_convexhull_2d.h
index 556dc79fc47..7417c1e3a98 100644
--- a/source/blender/blenlib/BLI_convexhull_2d.h
+++ b/source/blender/blenlib/BLI_convexhull_2d.h
@@ -21,10 +21,18 @@
  * \ingroup bli
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 int BLI_convexhull_2d_sorted(const float (*points)[2], const int n, int r_points[]);
 int BLI_convexhull_2d(const float (*points)[2], const int n, int r_points[]);
 
 float BLI_convexhull_aabb_fit_hull_2d(const float (*points_hull)[2], unsigned int n);
 float BLI_convexhull_aabb_fit_points_2d(const float (*points)[2], unsigned int n);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_CONVEXHULL_2D_H__ */
diff --git a/source/blender/blenlib/BLI_delaunay_2d.h b/source/blender/blenlib/BLI_delaunay_2d.h
index 9d853dd9509..95111dbbbf7 100644
--- a/source/blender/blenlib/BLI_delaunay_2d.h
+++ b/source/blender/blenlib/BLI_delaunay_2d.h
@@ -21,6 +21,10 @@
  * \ingroup bli
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * Interface for Constrained Delaunay Triangulation (CDT) in 2D.
  *
@@ -202,4 +206,8 @@ CDT_result *BLI_delaunay_2d_cdt_calc(const CDT_input *input, const CDT_output_ty
 
 void BLI_delaunay_2d_cdt_free(CDT_result *result);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_DELAUNAY_2D_H__ */
diff --git a/source/blender/blenlib/BLI_dial_2d.h b/source/blender/blenlib/BLI_dial_2d.h
index 71b0683d149..a39543720e6 100644
--- a/source/blender/blenlib/BLI_dial_2d.h
+++ b/source/blender/blenlib/BLI_dial_2d.h
@@ -46,10 +46,18 @@
  * \endcode
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct Dial Dial;
 
 Dial *BLI_dial_initialize(const float start_position[2], float threshold);
 
 float BLI_dial_angle(Dial *dial, const float current_position[2]);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_DIAL_2D_H__ */
diff --git a/source/blender/blenlib/BLI_dlrbTree.h b/source/blender/blenlib/BLI_dlrbTree.h
index 11e5e2c70e9..277d9116558 100644
--- a/source/blender/blenlib/BLI_dlrbTree.h
+++ b/source/blender/blenlib/BLI_dlrbTree.h
@@ -24,6 +24,10 @@
  * \ingroup bli
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Double-Linked Red-Black Tree Implementation:
  *
  * This is simply a Red-Black Tree implementation whose nodes can later
@@ -159,4 +163,8 @@ void BLI_dlrbTree_insert(DLRBT_Tree *tree, DLRBT_Node *node);
 
 /* ********************************************** */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_DLRBTREE_H__ */
diff --git a/source/blender/blenlib/BLI_dynlib.h b/source/blender/blenlib/BLI_dynlib.h
index 3359a70ef11..4adffd51e17 100644
--- a/source/blender/blenlib/BLI_dynlib.h
+++ b/source/blender/blenlib/BLI_dynlib.h
@@ -24,6 +24,10 @@
 #ifndef __BLI_DYNLIB_H__
 #define __BLI_DYNLIB_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct DynamicLibrary DynamicLibrary;
 
 DynamicLibrary *BLI_dynlib_open(const char *name);
@@ -31,4 +35,8 @@ void *BLI_dynlib_find_symbol(DynamicLibrary *lib, const char *symname);
 char *BLI_dynlib_get_error_as_string(DynamicLibrary *lib);
 void BLI_dynlib_close(DynamicLibrary *lib);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_DYNLIB_H__ */
diff --git a/source/blender/blenlib/BLI_dynstr.h b/source/blender/blenlib/BLI_dynstr.h
index 87e58d90d3f..cb1f3d58f23 100644
--- a/source/blender/blenlib/BLI_dynstr.h
+++ b/source/blender/blenlib/BLI_dynstr.h
@@ -34,6 +34,10 @@
 
 #include "BLI_compiler_attrs.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 struct DynStr;
 
 /** The abstract DynStr type */
@@ -57,4 +61,8 @@ void BLI_dynstr_get_cstring_ex(DynStr *__restrict ds, char *__restrict str) ATTR
 void BLI_dynstr_clear(DynStr *ds) ATTR_NONNULL();
 void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL();
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __BLI_DYNSTR_H__ */
diff --git a/source/blender/blenlib/BLI_edgehash.h b/source/blender/blenlib/BLI_edgehash.h
index 66797ee113f..bd149e2eaa0 100644
--- a/source/blender/blenlib/BLI_edgehash.h
+++ b/source/blender/blenlib/BLI_edgehash.h
@@ -23,6 +23,10 @@
 
 #include "BLI_compiler_attrs.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 stru

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list