aboutsummaryrefslogtreecommitdiffstats
path: root/common/b64enc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-10-24 16:42:37 +0000
committerWerner Koch <[email protected]>2017-10-24 16:44:49 +0000
commit812fe29bff42cf7dbd07e0becc55b2ada340dd97 (patch)
treee67141097b4f89c01bc031598245b0952d903685 /common/b64enc.c
parentbuild: Do not mess with CFLAGS in configure. (diff)
downloadgnupg-812fe29bff42cf7dbd07e0becc55b2ada340dd97.tar.gz
gnupg-812fe29bff42cf7dbd07e0becc55b2ada340dd97.zip
build: New configure option --enable-werror
* configure.ac: Implement that option. -- This can be used as a workaround in case of bogus autoconf tests. GnuPG-bug-id: 2423 Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/b64enc.c')
0 files changed, 0 insertions, 0 deletions
span> #include <io.h> #include "util.h" #include "sema.h" #include "debug.h" static void sema_fatal (const char *text) { fprintf (stderr, "sema.c: %s\n", text); abort (); } static void critsect_init (struct critsect_s *s) { CRITICAL_SECTION *mp; static CRITICAL_SECTION init_lock; static int initialized; if (!initialized) { /* The very first time we call this function, we assume that only one thread is running, so that we can bootstrap the semaphore code. */ InitializeCriticalSection (&init_lock); initialized = 1; } if (!s) return; /* we just want to initialize ourself */ /* first test whether it is really not initialized */ EnterCriticalSection (&init_lock); if ( s->private ) { LeaveCriticalSection (&init_lock); return; } /* now init it */ mp = malloc ( sizeof *mp ); if (!mp) { LeaveCriticalSection (&init_lock); sema_fatal ("out of core while creating critical section lock"); } InitializeCriticalSection (mp); s->private = mp; LeaveCriticalSection (&init_lock); } void _gpgme_sema_subsystem_init () { /* fixme: we should check that there is only one thread running */ critsect_init (NULL); } void _gpgme_sema_cs_enter ( struct critsect_s *s ) { if (!s->private) critsect_init (s); EnterCriticalSection ( (CRITICAL_SECTION*)s->private ); } void _gpgme_sema_cs_leave (struct critsect_s *s) { if (!s->private) critsect_init (s); LeaveCriticalSection ((CRITICAL_SECTION*)s->private); } void _gpgme_sema_cs_destroy ( struct critsect_s *s ) { if (s && s->private) { DeleteCriticalSection ((CRITICAL_SECTION*)s->private); free (s->private); s->private = NULL; } }