Message-ID: <4296897F.7060007 at rftp.com> Date: Thu, 26 May 2005 19:44:15 -0700 From: Robert Roessler Organization: Robert's High-performance Software MIME-Version: 1.0 To: lablgtk at math.nagoya-u.ac.jp Subject: Additional export request from dlllablgtk2 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit To "make things work", I implemented the following code in my OCaml-C-land widget interface: #ifdef CAML_DLL // create a Val_GtkWidget_sink here since we can't get at the one in "ml_gtk.c" #define gtk_object_ref_and_sink(w) (g_object_ref(w), gtk_object_sink(w)) Make_Val_final_pointer_ext(GtkObject, _sink , gtk_object_ref_and_sink, g_object_unref, 20) // (supports the Val_GtkWidget_sink impl) static void ml_raise_null_pointer() { static value * exn = NULL; if (exn == NULL) exn = caml_named_value ("null_pointer"); raise_constant (*exn); } #endif /* CAML_DLL */ 1) figuring out that I needed the CAML_DLL conditional compilation was "expensive" - including this code in a non-DLL ("lib") build caused major trouble :( 2) this lets me build and run LablGTK OCaml app, without *apparent* trouble - but I am not at all sure that it was the "right" thing to do 3) if Val_GtkWidget_sink was exported from the dlllablgtk2 DLL, then apps like mine (which wrap their own widgets) could have access to the "real" Val_GtkWidget_sink implementation just like the native builds 4) then I could remove this code entirely! :) Or do I have this all wrong? Robert Roessler robertr@rftp.com http://www.rftp.com