about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-01-07 11:00:47 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-01-07 11:00:47 +0100
commit29052c7a90ec2b524b26b8087f23a88004b9e879 (patch)
tree057dfc56a2795d66ab39f0bcfb5785f19ffb081d /src
parent48de41137dbb0b772cc0a1a241ca76ca431a4f8b (diff)
downloadbox64-29052c7a90ec2b524b26b8087f23a88004b9e879.tar.gz
box64-29052c7a90ec2b524b26b8087f23a88004b9e879.zip
Added (much) more slot for genereic GCallback on gobject2
Diffstat (limited to 'src')
-rw-r--r--src/include/super100.h102
-rw-r--r--src/wrapped/wrappedgobject2.c49
2 files changed, 129 insertions, 22 deletions
diff --git a/src/include/super100.h b/src/include/super100.h
new file mode 100644
index 00000000..47655662
--- /dev/null
+++ b/src/include/super100.h
@@ -0,0 +1,102 @@
+#define SUPER() \
+GO(0)   \
+GO(1)   \
+GO(2)   \
+GO(3)   \
+GO(4)   \
+GO(5)   \
+GO(6)   \
+GO(7)	\
+GO(8)	\
+GO(9)	\
+GO(10)	\
+GO(11)	\
+GO(12)  \
+GO(13)	\
+GO(14)	\
+GO(15)  \
+GO(16)  \
+GO(17)  \
+GO(18)  \
+GO(19)  \
+GO(20)	\
+GO(21)	\
+GO(22)  \
+GO(23)	\
+GO(24)	\
+GO(25)  \
+GO(26)  \
+GO(27)  \
+GO(28)  \
+GO(29)  \
+GO(30)	\
+GO(31)	\
+GO(32)  \
+GO(33)	\
+GO(34)	\
+GO(35)  \
+GO(36)  \
+GO(37)  \
+GO(38)  \
+GO(39)  \
+GO(40)	\
+GO(41)	\
+GO(42)  \
+GO(43)	\
+GO(44)	\
+GO(45)  \
+GO(46)  \
+GO(47)  \
+GO(48)  \
+GO(49)  \
+GO(50)	\
+GO(51)	\
+GO(52)  \
+GO(53)	\
+GO(54)	\
+GO(55)  \
+GO(56)  \
+GO(57)  \
+GO(58)  \
+GO(59)  \
+GO(60)	\
+GO(61)	\
+GO(62)  \
+GO(63)	\
+GO(64)	\
+GO(65)  \
+GO(66)  \
+GO(67)  \
+GO(68)  \
+GO(69)  \
+GO(70)	\
+GO(71)	\
+GO(72)  \
+GO(73)	\
+GO(74)	\
+GO(75)  \
+GO(76)  \
+GO(77)  \
+GO(78)  \
+GO(79)  \
+GO(80)	\
+GO(81)	\
+GO(82)  \
+GO(83)	\
+GO(84)	\
+GO(85)  \
+GO(86)  \
+GO(87)  \
+GO(88)  \
+GO(89)  \
+GO(90)	\
+GO(91)	\
+GO(92)  \
+GO(93)	\
+GO(94)	\
+GO(95)  \
+GO(96)  \
+GO(97)  \
+GO(98)  \
+GO(99)  \
+
diff --git a/src/wrapped/wrappedgobject2.c b/src/wrapped/wrappedgobject2.c
index a6ff1a51..00d74b84 100644
--- a/src/wrapped/wrappedgobject2.c
+++ b/src/wrapped/wrappedgobject2.c
@@ -446,28 +446,6 @@ static void* findWeakNotifyFct(void* fct)
     return NULL;
 }
 
-// GCallback  (generic function with 6 arguments, hopefully it's enough)
-#define GO(A)   \
-static uintptr_t my_GCallback_fct_##A = 0;                                                      \
-static void* my_GCallback_##A(void* a, void* b, void* c, void* d, void* e, void* f)             \
-{                                                                                               \
-    return (void*)RunFunctionFmt(my_GCallback_fct_##A, "pppppp", a, b, c, d, e, f); \
-}
-SUPER()
-#undef GO
-static void* findGCallbackFct(void* fct)
-{
-    if(!fct) return fct;
-    if(GetNativeFnc((uintptr_t)fct))  return GetNativeFnc((uintptr_t)fct);
-    #define GO(A) if(my_GCallback_fct_##A == (uintptr_t)fct) return my_GCallback_##A;
-    SUPER()
-    #undef GO
-    #define GO(A) if(my_GCallback_fct_##A == 0) {my_GCallback_fct_##A = (uintptr_t)fct; return my_GCallback_##A; }
-    SUPER()
-    #undef GO
-    printf_log(LOG_NONE, "Warning, no more slot for gobject Value Transform callback\n");
-    return NULL;
-}
 // GParamSpecTypeInfo....
 // First the structure GParamSpecTypeInfo statics, with paired x64 source pointer
 typedef struct my_GParamSpecTypeInfo_s {
@@ -609,6 +587,33 @@ static void* findcompareFct(void* fct)
 }
 #undef SUPER
 
+#include "super100.h"
+
+// GCallback  (generic function with 6 arguments, hopefully it's enough)
+#define GO(A)   \
+static uintptr_t my_GCallback_fct_##A = 0;                                                      \
+static void* my_GCallback_##A(void* a, void* b, void* c, void* d, void* e, void* f)             \
+{                                                                                               \
+    return (void*)RunFunctionFmt(my_GCallback_fct_##A, "pppppp", a, b, c, d, e, f); \
+}
+SUPER()
+#undef GO
+static void* findGCallbackFct(void* fct)
+{
+    if(!fct) return fct;
+    if(GetNativeFnc((uintptr_t)fct))  return GetNativeFnc((uintptr_t)fct);
+    #define GO(A) if(my_GCallback_fct_##A == (uintptr_t)fct) return my_GCallback_##A;
+    SUPER()
+    #undef GO
+    #define GO(A) if(my_GCallback_fct_##A == 0) {my_GCallback_fct_##A = (uintptr_t)fct; return my_GCallback_##A; }
+    SUPER()
+    #undef GO
+    printf_log(LOG_NONE, "Warning, no more slot for gobject generic GCallback\n");
+    return NULL;
+}
+
+#undef SUPER
+
 EXPORT uintptr_t my_g_signal_connect_object(x64emu_t* emu, void* instance, void* detailed, void* c_handler, void* object, uint32_t flags)
 {
     //TODO: get the type of instance to be more precise below