jonesmGatcom / ossbuild

Automatically exported from code.google.com/p/ossbuild
0 stars 0 forks source link

g_cond_timed_wait is missing from libglib-2.0-0.dll #117

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Trying to call Clock.Wait from the c# bindings will throw an 
EntryPointNotFoundException

Unable to find an entry point named 'g_cond_timed_wait' in DLL 
'libglib-2.0-0.dll'.

Looking into libglib-2.0-0.dll with depends I can see that indeed this function 
is missing.

Version used is 0.10.7 LGPL

Original issue reported on code.google.com by sca...@gmail.com on 9 Apr 2011 at 1:22

GoogleCodeExporter commented 9 years ago
It's not exported in the official GTK+ builds either (or at least I couldn't 
find them): http://www.gtk.org/download-windows.html

I think that the C# bindings are wrong. From gthread.h, g_cond_timed_wait() is 
#define'd as: 

# define g_cond_timed_wait(cond, mutex, abs_time)           \
    G_THREAD_CF (cond_timed_wait, TRUE,   (cond, mutex, abs_time))

or

# define g_cond_timed_wait(cond, mutex, abs_time)           \
    (g_thread_supported () ?                        \
      ((gboolean(*)(GCond*, GMutex*, GTimeVal*, gulong, gchar*))    \
        g_thread_functions_for_glib_use.cond_timed_wait)        \
          (cond, mutex, abs_time, G_MUTEX_DEBUG_MAGIC, G_STRLOC) : TRUE)

Naturally that won't be exported. It appears that glib uses a virtual function 
table and populates it with a platform-specific or overridable (user-defined) 
function. There is a g_cond_timed_wait_win32_impl() but that's declared as 
static and therefore not exported either. The C# bindings need to be fixed to 
properly use the function table. You'll want to submit this bug upstream it 
seems -- it doesn't seem to be a problem with our build.

Original comment by david.g.hoyt on 12 Apr 2011 at 12:19