# 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
])
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
])
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
#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)
{
#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