From dece7f87e789f35311bfab785fcd9a063ead1afd Mon Sep 17 00:00:00 2001 From: Dustin Sallings Date: Wed, 1 Feb 2012 00:11:17 -0800 Subject: [PATCH] Better detection of sasl_callback_ft --- configure.ac | 27 +++++++++++++++++++++++++++ sasl_defs.c | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 31f1f9dd89..9915a46529 100644 --- a/configure.ac +++ b/configure.ac @@ -301,6 +301,33 @@ AH_BOTTOM([#ifdef HAVE_INTTYPES_H #endif ]) +dnl ********************************************************************** +dnl Figure out if this system has the stupid sasl_callback_ft +dnl ********************************************************************** + +AC_DEFUN([AC_HAVE_SASL_CALLBACK_FT], +[AC_CACHE_CHECK(for sasl_callback_ft, ac_cv_has_sasl_callback_ft, +[ + AC_TRY_COMPILE([ + #ifdef HAVE_SASL_SASL_H + #include + #include + #endif + ],[ + sasl_callback_ft a_callback; + ],[ + ac_cv_has_sasl_callback_ft=yes + ],[ + ac_cv_has_sasl_callback_ft=no + ]) +]) +if test $ac_cv_has_sasl_callback_ft = yes; then + AC_DEFINE(HAVE_SASL_CALLBACK_FT, 1, [we have sasl_callback_ft]) +fi +]) + +AC_HAVE_SASL_CALLBACK_FT + dnl ********************************************************************** dnl DETECT_UINT64_SUPPORT dnl diff --git a/sasl_defs.c b/sasl_defs.c index 7922f66b48..1faefc80c0 100644 --- a/sasl_defs.c +++ b/sasl_defs.c @@ -18,7 +18,7 @@ const char * const locations[] = { }; #endif -#if SASL_VERSION_FULL < 0x20125 +#ifndef HAVE_SASL_CALLBACK_FT typedef int (*sasl_callback_ft)(void); #endif