gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: MYSQL: Improve header includes with resp


From: gnunet
Subject: [gnunet] branch master updated: MYSQL: Improve header includes with respect to compat handling
Date: Sun, 04 Dec 2022 13:54:53 +0100

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new a0914a0ad MYSQL: Improve header includes with respect to compat 
handling
a0914a0ad is described below

commit a0914a0ad18728e4b2b1632198d50d8b001a8890
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Sun Dec 4 21:53:26 2022 +0900

    MYSQL: Improve header includes with respect to compat handling
    
    Move the gnunet_private_config.h-dependant compatibility fix into
    gnunet_mysql_compat.h which is only included by implementations.
    May be reused by external users of gnunet_my_lib.h but they should
    check their platform on which types to use.
---
 src/datastore/plugin_datastore_mysql.c       |  1 +
 src/include/Makefile.am                      |  1 +
 src/include/gnunet_mhd_compat.h              |  2 +-
 src/include/gnunet_my_lib.h                  |  7 ++++++-
 src/include/gnunet_mysql_lib.h               | 11 -----------
 src/my/my.c                                  |  1 +
 src/my/my_query_helper.c                     |  1 +
 src/my/my_result_helper.c                    |  3 ++-
 src/mysql/mysql.c                            |  1 +
 src/regex/gnunet-regex-simulation-profiler.c |  1 +
 10 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/datastore/plugin_datastore_mysql.c 
b/src/datastore/plugin_datastore_mysql.c
index 216a6faa4..f62c51778 100644
--- a/src/datastore/plugin_datastore_mysql.c
+++ b/src/datastore/plugin_datastore_mysql.c
@@ -121,6 +121,7 @@
 #include "gnunet_datastore_plugin.h"
 #include "gnunet_util_lib.h"
 #include "gnunet_mysql_lib.h"
+#include "gnunet_mysql_compat.h"
 #include "gnunet_my_lib.h"
 
 #define MAX_DATUM_SIZE 65536
diff --git a/src/include/Makefile.am b/src/include/Makefile.am
index ca1aff6e1..86bcb0ec1 100644
--- a/src/include/Makefile.am
+++ b/src/include/Makefile.am
@@ -77,6 +77,7 @@ gnunetinclude_HEADERS = \
   gnunet_mst_lib.h \
   gnunet_mq_lib.h \
   gnunet_my_lib.h \
+  gnunet_mysql_compat.h \
   gnunet_mysql_lib.h \
   gnunet_namecache_plugin.h \
   gnunet_namecache_service.h \
diff --git a/src/include/gnunet_mhd_compat.h b/src/include/gnunet_mhd_compat.h
index ca41fb95a..7ef297c2f 100644
--- a/src/include/gnunet_mhd_compat.h
+++ b/src/include/gnunet_mhd_compat.h
@@ -36,7 +36,7 @@
 
 #else
 
-/**
+**
  * Data type to use for functions return an "MHD result".
  */
 #define MHD_RESULT int
diff --git a/src/include/gnunet_my_lib.h b/src/include/gnunet_my_lib.h
index 68ce16286..283b2f7e6 100644
--- a/src/include/gnunet_my_lib.h
+++ b/src/include/gnunet_my_lib.h
@@ -18,11 +18,12 @@
      SPDX-License-Identifier: AGPL3.0-or-later
  */
 /**
- * @addtogroup lib_extra 
+ * @addtogroup lib_extra
  * @{
  *
  * @author Christian Grothoff
  * @author Christophe Genevey
+ * @author Martin Schanzenbach
  *
  * @file
  * Helper library to access a MySQL database
@@ -39,6 +40,10 @@
 #include "gnunet_mysql_lib.h"
 #include <mysql/mysql.h>
 
+#ifndef MYSQL_BOOL
+#error "You need to define MYSQL_BOOL. See (or include) gnunet_mysql_compat.h"
+#endif
+
 #ifdef __cplusplus
 extern "C"
 {
diff --git a/src/include/gnunet_mysql_lib.h b/src/include/gnunet_mysql_lib.h
index 88408890b..52be3ff11 100644
--- a/src/include/gnunet_mysql_lib.h
+++ b/src/include/gnunet_mysql_lib.h
@@ -42,17 +42,6 @@ extern "C"
 #endif
 #endif
 
-#ifndef LIBMARIADB
-#ifdef HAVE_MYSQL8 && !LIBMARIADB
-  typedef bool MYSQL_BOOL;
-#else
-  typedef my_bool MYSQL_BOOL; //MySQL < 8 wants this
-#endif
-#else
-  typedef my_bool MYSQL_BOOL; //MariaDB still uses my_bool
-#endif
-
-
 /**
  * Mysql context.
  */
diff --git a/src/my/my.c b/src/my/my.c
index 468a4a47c..b667af4f9 100644
--- a/src/my/my.c
+++ b/src/my/my.c
@@ -25,6 +25,7 @@
  */
 #include "platform.h"
 #include <mysql/mysql.h>
+#include "gnunet_mysql_compat.h"
 #include "gnunet_my_lib.h"
 
 
diff --git a/src/my/my_query_helper.c b/src/my/my_query_helper.c
index e44caad91..c12970876 100644
--- a/src/my/my_query_helper.c
+++ b/src/my/my_query_helper.c
@@ -25,6 +25,7 @@
  */
 #include "platform.h"
 #include <mysql/mysql.h>
+#include "gnunet_mysql_compat.h"
 #include "gnunet_my_lib.h"
 
 
diff --git a/src/my/my_result_helper.c b/src/my/my_result_helper.c
index e500c0b27..ceebc6f37 100644
--- a/src/my/my_result_helper.c
+++ b/src/my/my_result_helper.c
@@ -25,6 +25,7 @@
 
 #include "platform.h"
 #include "gnunet_util_lib.h"
+#include "gnunet_mysql_compat.h"
 #include "gnunet_my_lib.h"
 
 
@@ -524,7 +525,7 @@ pre_extract_string (void *cls,
 
 
 /**
- * Check size of extracted fixed size data from a Mysql database 
+ * Check size of extracted fixed size data from a Mysql database
  *
  * @param cls closure
  * @param[in,out] rs
diff --git a/src/mysql/mysql.c b/src/mysql/mysql.c
index 4c701905c..056c2f07f 100644
--- a/src/mysql/mysql.c
+++ b/src/mysql/mysql.c
@@ -25,6 +25,7 @@
 #include "platform.h"
 #include <mysql/mysql.h>
 #include "gnunet_mysql_lib.h"
+#include "gnunet_mysql_compat.h"
 
 /**
  * Maximum number of supported parameters for a prepared
diff --git a/src/regex/gnunet-regex-simulation-profiler.c 
b/src/regex/gnunet-regex-simulation-profiler.c
index ab6d65d58..abdb1abeb 100644
--- a/src/regex/gnunet-regex-simulation-profiler.c
+++ b/src/regex/gnunet-regex-simulation-profiler.c
@@ -32,6 +32,7 @@
 #include "gnunet_util_lib.h"
 #include "regex_internal_lib.h"
 #include "gnunet_mysql_lib.h"
+#include "gnunet_mysql_compat.h"
 #include "gnunet_my_lib.h"
 #include <mysql/mysql.h>
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]