Explorar el Código

+ Patch from Mattias Gaertner to fix G_TYPE_INSTANCE_GET_CLASS

git-svn-id: trunk@123 -
michael hace 20 años
padre
commit
0a1a92f1aa
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      packages/extra/gtk2/glib/glib2.pas

+ 4 - 1
packages/extra/gtk2/glib/glib2.pas

@@ -1294,8 +1294,11 @@ begin
 end;
 end;
 
 
 function G_TYPE_INSTANCE_GET_CLASS(instance: Pointer; g_type: GType) : PGTypeClass;
 function G_TYPE_INSTANCE_GET_CLASS(instance: Pointer; g_type: GType) : PGTypeClass;
+// #define G_TYPE_INSTANCE_GET_CLASS(instance, g_type, c_type)     (_G_TYPE_IGC ((instance), (g_type), c_type))
+// #define _G_TYPE_IGC(ip, gt, ct)         ((ct*) (((GTypeInstance*) ip)->g_class))
 begin
 begin
-   G_TYPE_INSTANCE_GET_CLASS:=private_g_type_check_class_cast(instance,g_type);
+   Result:=PGTypeInstance(Instance)^.g_class;
+   Result:=private_g_type_check_class_cast(Result,g_type);
 end;
 end;
 
 
 function G_TYPE_INSTANCE_GET_INTERFACE(instance: Pointer; g_type: GType) : Pointer;
 function G_TYPE_INSTANCE_GET_INTERFACE(instance: Pointer; g_type: GType) : Pointer;