summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2003-05-12 00:36:05 +0000
committerjbj <devnull@localhost>2003-05-12 00:36:05 +0000
commite77ef01a5f41a71b9846985e588d21ba9b289679 (patch)
tree81fae69f6a941a3f7f83b0f3bb97e4b754a3c2d0
parentd5ccace91a8abca1ee0123fcac7d6922b287baef (diff)
downloadlibrpm-tizen-e77ef01a5f41a71b9846985e588d21ba9b289679.tar.gz
librpm-tizen-e77ef01a5f41a71b9846985e588d21ba9b289679.tar.bz2
librpm-tizen-e77ef01a5f41a71b9846985e588d21ba9b289679.zip
Use bc_lock_t to hide type of locking.
CVS patchset: 6835 CVS date: 2003/05/12 00:36:05
-rw-r--r--beecrypt/configure.ac5
-rw-r--r--beecrypt/fips186.h31
-rw-r--r--beecrypt/mtprng.h11
-rw-r--r--beecrypt/types.h.in3
4 files changed, 14 insertions, 36 deletions
diff --git a/beecrypt/configure.ac b/beecrypt/configure.ac
index 4e58cdee9..e1fd1f6f6 100644
--- a/beecrypt/configure.ac
+++ b/beecrypt/configure.ac
@@ -357,14 +357,17 @@ fi
# Checks for libraries.
# XXX Insert "typedef foo bc_lock_t" into types.h.
+include_pthread_h=
typedef_bc_lock_t=
if test "$ac_enable_threads" = yes; then
if test "$ac_cv_header_thread_h" = yes; then
AC_SEARCH_LIBS([mutex_lock],[thread],[
AC_DEFINE([ENABLE_THREADS],1)
if test "$ac_cv_header_sync_h" = yes; then
+ include_pthread_h='#include <sync.h>'
typedef_bc_lock_t='typedef mutex_t bc_lock_t;'
else
+ include_pthread_h='#include <pthread.h>'
typedef_bc_lock_t='typedef pthread_mutex_t bc_lock_t;'
fi
])
@@ -372,6 +375,7 @@ if test "$ac_enable_threads" = yes; then
AC_SEARCH_LIBS([pthread_mutex_lock],[pthread],[
AC_DEFINE([ENABLE_THREADS],1)
if test "$ac_cv_header_pthread_h" = yes; then
+ include_pthread_h='#include <pthread.h>'
typedef_bc_lock_t='typedef pthread_mutex_t bc_lock_t;'
fi
])
@@ -379,6 +383,7 @@ if test "$ac_enable_threads" = yes; then
AC_MSG_WARN([Don't know which thread library to check for])
fi
fi
+AC_SUBST(include_pthread_h)
AC_SUBST(typedef_bc_lock_t)
if test "$ac_enable_aio" = yes; then
diff --git a/beecrypt/fips186.h b/beecrypt/fips186.h
index 5295864d3..974d665a9 100644
--- a/beecrypt/fips186.h
+++ b/beecrypt/fips186.h
@@ -27,22 +27,6 @@
#define _FIPS186_H
#include "beecrypt.h"
-
-#ifdef _REENTRANT
-# if WIN32
-# include <windows.h>
-# include <winbase.h>
-# else
-# if HAVE_THREAD_H && HAVE_SYNCH_H
-# include <synch.h>
-# elif HAVE_PTHREAD_H
-# include <pthread.h>
-# else
-# error need locking mechanism
-# endif
-# endif
-#endif
-
#include "sha1.h"
#if (MP_WBITS == 64)
@@ -59,21 +43,14 @@ typedef struct
{
#ifdef _REENTRANT
# if WIN32
- HANDLE lock;
+ HANDLE lock;
# else
- # if HAVE_THREAD_H && HAVE_SYNCH_H
- mutex_t lock;
- # elif HAVE_PTHREAD_H
- pthread_mutex_t lock;
- # else
- # error need locking mechanism
- # endif
- # endif
+ bc_lock_t lock;
#endif
sha1Param param;
- mpw state[FIPS186_STATE_SIZE];
+ mpw state[FIPS186_STATE_SIZE];
byte digest[20];
- int digestremain;
+ int digestremain;
} fips186Param;
#ifdef __cplusplus
diff --git a/beecrypt/mtprng.h b/beecrypt/mtprng.h
index baf3dc83f..25a84d42b 100644
--- a/beecrypt/mtprng.h
+++ b/beecrypt/mtprng.h
@@ -38,16 +38,9 @@ typedef struct
{
#ifdef _REENTRANT
# if WIN32
- HANDLE lock;
+ HANDLE lock;
# else
- # if HAVE_THREAD_H && HAVE_SYNCH_H
- mutex_t lock;
- # elif HAVE_PTHREAD_H
- pthread_mutex_t lock;
- # else
- # error need locking mechanism
- # endif
- # endif
+ bc_lock_t lock;
#endif
uint32_t state[N+1];
uint32_t left;
diff --git a/beecrypt/types.h.in b/beecrypt/types.h.in
index 05f53a01d..61574b08a 100644
--- a/beecrypt/types.h.in
+++ b/beecrypt/types.h.in
@@ -95,6 +95,9 @@ typedef uint16_t mphw;
# error
#endif
+#if defined(_REENTRANT)
+@include_pthread_h@
@typedef_bc_lock_t@
+#endif
#endif /* _TYPES_H */