[sr-dev] git:master:1736723c: db_mysql: replaced my_bool with bool

Daniel-Constantin Mierla miconda at gmail.com
Fri Aug 3 00:33:48 CEST 2018


Module: kamailio
Branch: master
Commit: 1736723cc2a15bb75c26711675712a966161b722
URL: https://github.com/kamailio/kamailio/commit/1736723cc2a15bb75c26711675712a966161b722

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-08-03T00:33:29+02:00

db_mysql: replaced my_bool with bool

- mysql 8.0.1 removed my_bool and suggests use of bool:
  * https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html
- use stdbool.h, it defines bool in C99, which should be old enough to
be everywhere, otherwise it may require some ifdefs to get it for older
but still alive systems
- reported by GH #1602

---

Modified: src/modules/db_mysql/km_my_con.c
Modified: src/modules/db_mysql/my_fld.h

---

Diff:  https://github.com/kamailio/kamailio/commit/1736723cc2a15bb75c26711675712a966161b722.diff
Patch: https://github.com/kamailio/kamailio/commit/1736723cc2a15bb75c26711675712a966161b722.patch

---

diff --git a/src/modules/db_mysql/km_my_con.c b/src/modules/db_mysql/km_my_con.c
index 38e6875a19..242329e295 100644
--- a/src/modules/db_mysql/km_my_con.c
+++ b/src/modules/db_mysql/km_my_con.c
@@ -29,6 +29,7 @@
 #include "km_my_con.h"
 #include "km_db_mysql.h"
 #include <mysql.h>
+#include <stdbool.h>
 #include "../../core/mem/mem.h"
 #include "../../core/dprint.h"
 #include "../../core/ut.h"
@@ -44,7 +45,7 @@ struct my_con* db_mysql_new_connection(const struct db_id* id)
 	char *host, *grp, *egrp;
 	unsigned int connection_flag = 0;
 #if MYSQL_VERSION_ID > 50012
-	my_bool rec;
+	bool rec;
 #endif
 
 	if (!id) {
diff --git a/src/modules/db_mysql/my_fld.h b/src/modules/db_mysql/my_fld.h
index 4450a26d06..539a4df699 100644
--- a/src/modules/db_mysql/my_fld.h
+++ b/src/modules/db_mysql/my_fld.h
@@ -29,12 +29,13 @@
 #include "../../lib/srdb2/db_drv.h"
 #include "../../lib/srdb2/db_fld.h"
 #include <mysql.h>
+#include <stdbool.h>
 
 struct my_fld {
 	db_drv_t gen;
 
 	char* name;
-	my_bool is_null;
+	bool is_null;
 	MYSQL_TIME time;
 	unsigned long length;
 	str buf;




More information about the sr-dev mailing list