Index: libgpg-error-1.16/src/gen-w32-lock-obj.c =================================================================== --- libgpg-error-1.16/src/gen-w32-lock-obj.c +++ libgpg-error-1.16/src/gen-w32-lock-obj.c @@ -31,7 +31,6 @@ #include "w32-lock-obj.h" - int main (void) { @@ -39,12 +38,24 @@ unsigned char *p; int i; - printf ("sizeof CRITICAL_SECTION = %u\n", (int)sizeof (CRITICAL_SECTION)); - printf ("sizeof _gpgrt_lock_t = %u\n", (int)sizeof lk); - + //printf ("sizeof CRITICAL_SECTION = %u\n", (int)sizeof (CRITICAL_SECTION)); + //printf ("sizeof _gpgrt_lock_t = %u\n", (int)sizeof lk); + i = sizeof lk - ((void*)&lk.initdone - (void*)&lk); // size left without first long + alignment of struct + printf ("typedef struct\n" + "{\n" + " long _vers;\n" + " union {\n" + " volatile char _priv[%d];\n" + " long _x_align;\n" + " long *_xp_align;\n" + " } u;\n" + "} gpgrt_lock_t;\n", + i); + memset (&lk, 0, sizeof lk); lk.vers = LOCK_ABI_VERSION; lk.started = -1; + printf ("#define GPGRT_LOCK_INITIALIZER {"); p = (unsigned char *)&lk; for (i=0; i < sizeof lk - 1; i++)