summaryrefslogtreecommitdiff
blob: 4f0eed297363858aed643095ab42bfaf0d4070be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
From: Stephane Glondu <steph@glondu.net>
Date: Sat, 15 Aug 2020 09:08:30 +0200
Subject: Fix multiple definitions of variables

Bug-Debian: https://bugs.debian.org/968427
Bug: https://github.com/Chris00/ocaml-cairo/issues/23
Forwarded: https://github.com/Chris00/ocaml-cairo/issues/23
---
 src/cairo_ocaml.h.p     | 18 +++++++++---------
 src/cairo_ocaml_types.h |  4 +++-
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/cairo_ocaml.h.p b/src/cairo_ocaml.h.p
index 4192aed..1f05664 100644
--- a/src/cairo_ocaml.h.p
+++ b/src/cairo_ocaml.h.p
@@ -25,7 +25,7 @@
 /* cairo_t
 ***********************************************************************/
 #define CAIRO_VAL(v) (* (cairo_t **) Data_custom_val(v))
-struct custom_operations caml_cairo_ops;
+extern struct custom_operations caml_cairo_ops;
 
 void caml_cairo_raise_Error(cairo_status_t status);
 /* raise [Cairo.Error] if the status indicates a failure. */
@@ -33,7 +33,7 @@ void caml_cairo_raise_Error(cairo_status_t status);
 /* cairo_pattern_t
 ***********************************************************************/
 #define PATTERN_VAL(v) (* (cairo_pattern_t **) Data_custom_val(v))
-struct custom_operations caml_pattern_ops;
+extern struct custom_operations caml_pattern_ops;
 
 #define EXTEND_VAL(v) ((cairo_extend_t) Int_val(v))
 #define VAL_EXTEND(v) Val_int(v)
@@ -45,12 +45,12 @@ struct custom_operations caml_pattern_ops;
 ***********************************************************************/
 
 #define FONT_OPTIONS_VAL(v) (* (cairo_font_options_t**) Data_custom_val(v))
-struct custom_operations caml_font_options_ops;
+extern struct custom_operations caml_font_options_ops;
 
 /* cairo_font_type_t
 ***********************************************************************/
 
-value caml_cairo_font_type[5];
+extern value caml_cairo_font_type[5];
 
 cairo_font_type_t caml_cairo_font_type_val(value vft);
 
@@ -61,13 +61,13 @@ cairo_font_type_t caml_cairo_font_type_val(value vft);
 ***********************************************************************/
 
 #define SCALED_FONT_VAL(v) (* (cairo_scaled_font_t**) Data_custom_val(v))
-struct custom_operations caml_scaled_font_ops;
+extern struct custom_operations caml_scaled_font_ops;
 
 /* cairo_surface_t
 ***********************************************************************/
 
 #define SURFACE_VAL(v) (* (cairo_surface_t **) Data_custom_val(v))
-struct custom_operations caml_surface_ops;
+extern struct custom_operations caml_surface_ops;
 
 /* Type cairo_content_t */
 
@@ -93,7 +93,7 @@ struct custom_operations caml_surface_ops;
 ***********************************************************************/
 
 #define PATH_VAL(v) (* (cairo_path_t **) Data_custom_val(v))
-struct custom_operations caml_path_ops;
+extern struct custom_operations caml_path_ops;
 
 #define PATH_DATA_ASSIGN(vdata, data)                                   \
   switch (data->header.type) {                                          \
@@ -151,10 +151,10 @@ struct custom_operations caml_path_ops;
 #include <cairo-ft.h>
 
 #define FT_LIBRARY_VAL(v) (* (FT_Library*) Data_custom_val(v))
-struct custom_operations caml_cairo_ft_library_ops;
+extern struct custom_operations caml_cairo_ft_library_ops;
 
 #define FT_FACE_VAL(v) (* (FT_Face*) Data_custom_val(v))
-struct custom_operations caml_cairo_ft_face_ops;
+extern struct custom_operations caml_cairo_ft_face_ops;
 
 #endif /* OCAML_CAIRO_HAS_FT */
 
diff --git a/src/cairo_ocaml_types.h b/src/cairo_ocaml_types.h
index b850ae2..84dde3d 100644
--- a/src/cairo_ocaml_types.h
+++ b/src/cairo_ocaml_types.h
@@ -276,7 +276,9 @@ struct custom_operations caml_font_options_ops = {
   custom_deserialize_default };
 
 
-/* caml_cairo_font_type is defined in "cairo_ocaml.h". */
+/* caml_cairo_font_type is exported in "cairo_ocaml.h". */
+value caml_cairo_font_type[5];
+
 CAMLexport value caml_cairo_font_type_init(value unit)
 {
   /* noalloc */