LIBS="$MYSQL_LIBS $LIBS"
AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([#include <mysql.h>],
- [MYSQL mysql_handle;
- (void) mysql_init(&mysql_handle);
- ])],
- [AC_MSG_RESULT([checking for MySQL headers and library... yes])],
- [AC_MSG_RESULT([checking for MySQL headers and library... no])
- AC_MSG_ERROR([Needs MySQL library])]
+ [AC_LANG_PROGRAM([#include <mysql.h>],
+ [MYSQL mysql_handle;
+ (void) mysql_init(&mysql_handle);
+ ])],
+ [AC_MSG_RESULT([checking for MySQL headers and library... yes])],
+ [AC_MSG_RESULT([checking for MySQL headers and library... no])
+ AC_MSG_ERROR([Needs MySQL library])]
)
+ # Note that MYSQL is present in the config.h file
+ AC_DEFINE([HAVE_MYSQL], [1], [MySQL is present])
+
+ # Check is my_bool is defined.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([#include <mysql.h>
+ const my_bool MLM_FALSE = 0;]
+ [])],
+ [AC_MSG_RESULT([checking for MySQL my_bool... yes])
+ AC_DEFINE([HAVE_MYSQL_MY_BOOL], [1], [MySQL uses my_bool])],
+ [AC_MSG_RESULT([checking for MySQL my_bool... no])])
+
CPPFLAGS=$CPPFLAGS_SAVED
LIBS=$LIBS_SAVED
- # Note that MYSQL is present in the config.h file
- AC_DEFINE([HAVE_MYSQL], [1], [MySQL is present])
fi
# Solaris puts FIONREAD in filio.h
///
//@{
+#ifdef HAVE_MYSQL_MY_BOOL
/// @brief MySQL false value.
const my_bool MLM_FALSE = 0;
/// @brief MySQL true value.
const my_bool MLM_TRUE = 1;
+#else
+/// @brief my_bool type for MySQL 8.x.
+typedef bool my_bool;
+
+/// @brief MySQL false value.
+const my_bool MLM_FALSE = false;
+
+/// @brief MySQL true value.
+const my_bool MLM_TRUE = true;
+#endif
+
/// @brief MySQL fetch success code.
const int MLM_MYSQL_FETCH_SUCCESS = 0;