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>