configure: Add check for MySQL client bool and my_bool type usage.

Instead of trying to use the defined MySQL client version from the
header use a configure check to determine whether the bool or my_bool
type should be used for defining a boolean.

ASTERISK-28604

Change-Id: Id2225b3785115de074c50c123ff1a68005b4a9c7
This commit is contained in:
Joshua C. Colp
2019-12-16 08:35:31 -04:00
parent 7e441d6b25
commit ed394ce5b1
4 changed files with 106 additions and 10 deletions

View File

@@ -173,9 +173,9 @@ static int mysql_log(struct ast_cdr *cdr)
{
struct ast_str *sql1 = ast_str_thread_get(&sql1_buf, 1024), *sql2 = ast_str_thread_get(&sql2_buf, 1024);
int retries = 5;
#if MYSQL_VERSION_ID >= 80001
#ifdef HAVE_MYSQLCLIENT_BOOL
bool my_bool_true = 1;
#elif MYSQL_VERSION_ID >= 50013
#elif HAVE_MYSQLCLIENT_MY_BOOL
my_bool my_bool_true = 1;
#endif
@@ -470,9 +470,9 @@ static int my_connect_db(struct ast_config *cfg)
MYSQL_ROW row;
MYSQL_RES *result;
char sqldesc[128];
#if MYSQL_VERSION_ID >= 80001
#ifdef HAVE_MYSQLCLIENT_BOOL
bool my_bool_true = 1;
#elif MYSQL_VERSION_ID >= 50013
#elif HAVE_MYSQLCLIENT_MY_BOOL
my_bool my_bool_true = 1;
#endif