summaryrefslogtreecommitdiff
blob: 41615ac49a302b5686f521213b26e01f979e823e (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
--- inkscape-0.48.4/src/gc-core.h.old	2013-12-31 01:22:38.976653890 +0400
+++ inkscape-0.48.4/src/gc-core.h	2013-12-31 01:22:48.525653608 +0400
@@ -57,7 +57,7 @@
                                            CleanupFunc *old_func,
                                            void **old_data);
     int (*general_register_disappearing_link)(void **p_ptr,
-                                              void *base);
+                                              const void *base);
     int (*unregister_disappearing_link)(void **p_ptr);
     std::size_t (*get_heap_size)();
     std::size_t (*get_free_bytes)();
--- inkscape-0.48.4/src/gc.cpp.old	2013-12-31 01:23:50.462651778 +0400
+++ inkscape-0.48.4/src/gc.cpp	2013-12-31 01:40:37.718622017 +0400
@@ -70,8 +70,8 @@
     return base + debug_base_fixup();
 }
 
-int debug_general_register_disappearing_link(void **p_ptr, void *base) {
-    char *real_base=reinterpret_cast<char *>(base) - debug_base_fixup();
+int debug_general_register_disappearing_link(void **p_ptr, const void *base) {
+    char *real_base=const_cast<char *>(reinterpret_cast<const char *>(base)) - debug_base_fixup();
     return GC_general_register_disappearing_link(p_ptr, real_base);
 }
 
@@ -90,7 +90,7 @@
     }
 }
 
-int dummy_general_register_disappearing_link(void **, void *) { return false; }
+int dummy_general_register_disappearing_link(void **, const void *) { return false; }
 
 int dummy_unregister_disappearing_link(void **/*link*/) { return false; }
 
@@ -112,7 +112,11 @@
     &GC_malloc_atomic_uncollectable,
     &GC_base,
     &GC_register_finalizer_ignore_self,
+#if (GC_MAJOR_VERSION >= 7 && GC_MINOR_VERSION >= 4)
     &GC_general_register_disappearing_link,
+#else
+    (int (*)(void**, const void*))(&GC_general_register_disappearing_link),
+#endif
     &GC_unregister_disappearing_link,
     &GC_get_heap_size,
     &GC_get_free_bytes,
@@ -202,7 +206,7 @@
     die_because_not_initialized();
 }
 
-int stub_general_register_disappearing_link(void **, void *) {
+int stub_general_register_disappearing_link(void **, const void *) {
     die_because_not_initialized();
     return 0;
 }