aboutsummaryrefslogtreecommitdiffstats
path: root/src/gen-posix-lock-obj.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-01-09 18:14:09 +0000
committerWerner Koch <[email protected]>2014-01-17 17:06:37 +0000
commite07538c0ed3c5cb3d870a490a4c12bef4375278a (patch)
tree147e33abcf92c0dc87ebb1f1b7363980a9194714 /src/gen-posix-lock-obj.c
parentExtend the platform dependent build rules. (diff)
downloadlibgpg-error-e07538c0ed3c5cb3d870a490a4c12bef4375278a.tar.gz
libgpg-error-e07538c0ed3c5cb3d870a490a4c12bef4375278a.zip
Move version number first in the Posix lock-obj.
* src/posix-lock-obj.h (_gpgrt_lock_t): Swap VERS and MTX and put MTX into a union. * src/posix-lock.c (gpgrt_lock_lock): Adjust for this change. * src/gen-posix-lock-obj.c (main): Change output accordingly. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--src/gen-posix-lock-obj.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gen-posix-lock-obj.c b/src/gen-posix-lock-obj.c
index 5dbc6c6..7644c6f 100644
--- a/src/gen-posix-lock-obj.c
+++ b/src/gen-posix-lock-obj.c
@@ -70,30 +70,31 @@ main (void)
"## File created by " PGM " - DO NOT EDIT\n"
"## To be included by mkheader into gpg-error.h\n"
"\n"
- "typedef union\n"
+ "typedef struct\n"
"{\n"
- " struct {\n"
+ " long _vers;\n"
+ " union {\n"
" volatile char _priv[%d];\n"
- " long _vers;\n"
- " } d;\n"
- " long _x_align;\n"
- " long *_xp_align;\n"
+ " long _x_align;\n"
+ " long *_xp_align;\n"
+ " } u;\n"
"} gpgrt_lock_t;\n"
"\n"
- "#define GPGRT_LOCK_INITIALIZER {{{",
+ "#define GPGRT_LOCK_INITIALIZER {%d,{{",
HOST_TRIPLET_STRING,
- SIZEOF_PTHREAD_MUTEX_T);
+ SIZEOF_PTHREAD_MUTEX_T,
+ LOCK_ABI_VERSION);
p = (unsigned char *)&mtx;
for (i=0; i < sizeof mtx; i++)
{
if (i && !(i % 8))
- printf (" \\\n%*s", 34, "");
+ printf (" \\\n%*s", 36, "");
printf ("%u", p[i]);
if (i < sizeof mtx - 1)
putchar (',');
}
- printf ("},%d}}\n", LOCK_ABI_VERSION);
- fputs ("##\n"
+ fputs ("}}}\n"
+ "##\n"
"## Loc" "al Variables:\n"
"## mode: c\n"
"## buffer-read-only: t\n"