glib\guitls.h, atexit and the windows DDK



i'm in the midst of getting netperf4:

http://www.netperf.org/svn/netperf4/trunk/

ported to Windows. As a first step I have it optionally using Glib/Gthread under Linux.

Netperf4 also uses libxml2. I've gotten those bits downloaded and placed under my build directory. The Win32 stuff was done with the Windows DDK. Netperf2 was ported to Windows using the DDK and I'd like to continue that because I'd like to keep the dependencies to a minimum.

I've downloaded both Tor's 2.6.8 Win32 glib bits and the 2.6.10 stuff, and when I do the build /cD thing the first complaint out of the compiler (among many :) is that in line 239 of gutils.h atexit is being redefined with different type modifiers (error C2373)

Notepad is useless for looking at the include file (pointers on that score most welcome) but looking on my Debian box (and ass-u-me-ing the versions are 'close enough' I see:

#ifdef G_OS_WIN32
/* It's a bad idea to wrap atexit() on Windows. If the GLib DLL calls
 * atexit(), the function will be called when the GLib DLL is detached
 * from the program, which is not what the caller wants. The caller
 * wants the function to be called when it *itself* exits (or is
 * detached, in case the caller, too, is a DLL).
 */
int atexit (void (*)(void));
#define g_atexit(func) atexit(func)
#endif

am I just missing something really simple? I would have thought that would be an extern int right? (not that that might have made a difference) It is entirely possible as my Windows knowledge is nearly nil and I've only just begun with glib.

I did a _brief_ search on www.microsoft.com for "atexit" and some of the first hits which appeared seem to say that atexit was:

int atexit (void(__cdecl * func)(void))

rick jones



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]