]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[354-compilation-with-mysql-fails-on-fedora-29] Added HAVE_MYSQL_MY_BOOL
authorFrancis Dupont <fdupont@isc.org>
Fri, 21 Dec 2018 15:59:47 +0000 (16:59 +0100)
committerFrancis Dupont <fdupont@isc.org>
Thu, 7 Feb 2019 22:02:22 +0000 (17:02 -0500)
configure.ac
src/lib/mysql/mysql_constants.h

index a986e8ba1d11a8d6fd087ae4d336e41cb3547b54..01dbb61d5b4fa2d291b1b8ecc05e4e3249969013 100644 (file)
@@ -727,20 +727,30 @@ if test "$MYSQL_CONFIG" != "" ; then
     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
index ee1a8937e66ce2049026cc3791a136d044b09597..64b052017cda2696ed27b014a88020ed97182b0f 100644 (file)
@@ -16,12 +16,24 @@ namespace db {
 ///
 //@{
 
+#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;