fi
# Checks for libraries.
+# XXX Insert "typedef foo bc_lock_t" into types.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
+ typedef_bc_lock_t='typedef mutex_t bc_lock_t;'
+ else
+ typedef_bc_lock_t='typedef pthread_mutex_t bc_lock_t;'
+ fi
])
elif test "$ac_cv_header_pthread_h" = yes; then
AC_SEARCH_LIBS([pthread_mutex_lock],[pthread],[
AC_DEFINE([ENABLE_THREADS],1)
+ if test "$ac_cv_header_pthread_h" = yes; then
+ typedef_bc_lock_t='typedef pthread_mutex_t bc_lock_t;'
+ fi
])
else
AC_MSG_WARN([Don't know which thread library to check for])
fi
fi
+AC_SUBST(typedef_bc_lock_t)
if test "$ac_enable_aio" = yes; then
BEECRYPT_WORKING_AIO
BEECRYPT_INT_TYPES
BEECRYPT_CPU_BITS
+# XXX Insert correct stdint includes into types.h.
+include_stdint_h=
+if test "$ac_cv_header_stdint_h" = yes; then
+ include_stdint_h='#include <stdint.h>'
+elif test "$ac_cv_header_inttypes_h" = yes; then
+ include_stdint_h='#include <inttypes.h>'
+else
+ include_stdint_h='
+typedef signed char int8_t;\
+typedef short int int16_t;\
+typedef int int32_t;\
+typedef long long int int64_t;\
+typedef unsigned char uint8_t;\
+typedef unsigned short int uint16_t;\
+typedef unsigned int uint32_t;\
+typedef unsigned long long int uint64_t;\
+'
+fi
+AC_SUBST(include_stdint_h)
+
if test "$ac_with_javaglue" = yes ; then
CFLAGS="$CFLAGS -I$ac_cv_java_include"
case $target_os in
/*
- * types.h
- *
- * Types.h generic system types file
- *
- * Copyright (c) 2000 Virtual Unlimited B.V.
- *
- * Author: Bob Deblier <bob@virtualunlimited.com>
+ * Copyright (c) 2000, 2003 Virtual Unlimited B.V.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
*/
-#ifndef _BEECRYPT_TYPES_H
-#define _BEECRYPT_TYPES_H
+/*!\file types.h
+ * \brief BeeCrypt API, portability headers.
+ * \author Bob Deblier <bob.deblier@pandora.be>
+ */
+
+#ifndef _TYPES_H
+#define _TYPES_H
-#if WIN32 && !__CYGWIN32__
-# ifdef BEECRYPT_DLL_EXPORT
-# define BEECRYPTAPI __declspec(dllexport)
-# else
-# define BEECRYPTAPI __declspec(dllimport)
-# endif
-#else
# define BEECRYPTAPI
-#endif
-#include <stdint.h>
+@include_stdint_h@
/* Starting from GCC 3.2, the compiler seems smart enough to figure
* out that we're trying to do a rotate without having to specify it.
# error
#endif
-#endif /* _BEECRYPT_TYPES_H */
+@typedef_bc_lock_t@
+
+#endif /* _TYPES_H */