Changeset View
Changeset View
Standalone View
Standalone View
libgpg-error-1.16/src/gen-w32-lock-obj.c
Context not available. | |||||
#include "w32-lock-obj.h" | #include "w32-lock-obj.h" | ||||
int | int | ||||
main (void) | main (void) | ||||
{ | { | ||||
Context not available. | |||||
unsigned char *p; | unsigned char *p; | ||||
int i; | int i; | ||||
printf ("sizeof CRITICAL_SECTION = %u\n", (int)sizeof (CRITICAL_SECTION)); | //printf ("sizeof CRITICAL_SECTION = %u\n", (int)sizeof (CRITICAL_SECTION)); | ||||
printf ("sizeof _gpgrt_lock_t = %u\n", (int)sizeof lk); | //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); | memset (&lk, 0, sizeof lk); | ||||
lk.vers = LOCK_ABI_VERSION; | lk.vers = LOCK_ABI_VERSION; | ||||
lk.started = -1; | lk.started = -1; | ||||
printf ("#define GPGRT_LOCK_INITIALIZER {"); | printf ("#define GPGRT_LOCK_INITIALIZER {"); | ||||
p = (unsigned char *)&lk; | p = (unsigned char *)&lk; | ||||
for (i=0; i < sizeof lk - 1; i++) | for (i=0; i < sizeof lk - 1; i++) | ||||
Context not available. |