Support locking under Windows.
authorWerner Koch <wk@gnupg.org>
Thu, 9 Jan 2014 18:14:09 +0000 (19:14 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 24 Jan 2014 09:19:15 +0000 (10:19 +0100)
commitfa42c61a84996b6a7574c32233dfd8d9f254d93a
tree5fa4fda493d1c45648466936aff5d3bad93853e9
parentd76fffaedce6e93304b69ea690213836ed3b9a38
Support locking under Windows.

* src/ath.c: Add support for Windows.
* src/global.c (external_lock_test): New.
(_gcry_vcontrol): Call new function with formerly reserved code 61.

* tests/t-common.h: New. Taken from current libgpg-error.
* tests/t-lock.c: New.  Based on t-lock.c from libgpg-error.
* configure.ac (HAVE_PTHREAD): Set macro to 1 if defined.
(AC_CHECK_FUNCS): Check for flockfile.
* tests/Makefile.am (tests_bin): Add t-lock.
(noinst_HEADERS): Add t-common.h
(LDADD): Move value to ...
(default_ldadd): new.
(t_lock_LDADD): New.
--

1.6.0 misses locking for Windows and non ELF systems.  This patch
fixes the Windows case.

For 1.7 we will use the forthcoming gpgrt locking functions of
libgpg-error.  However, we don't want to to that for 1.6. and thus
implement W32 locking directly.  We further add a test feature for the
locking functions.

Signed-off-by: Werner Koch <wk@gnupg.org>
configure.ac
src/ath.c
src/global.c
tests/Makefile.am
tests/t-common.h [new file with mode: 0644]
tests/t-lock.c [new file with mode: 0644]