From 7a766b7165d49b01472d277fe0df255dd1957694 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 26 Feb 2021 22:55:01 +0100 Subject: [PATCH] TT#111150 When using MariaDB use its namespaced headers This makes sure we use headers found in the appropriate non-compatibility library. Change-Id: I6e228224c2caef3b0b095666aace49a23d8e6959 --- Makefile | 4 ++-- medmysql.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ee8b84a..47b347b 100644 --- a/Makefile +++ b/Makefile @@ -10,10 +10,10 @@ GLIB_CFLAGS := $(shell pkg-config glib-2.0 --cflags) # mariadb/mysql support ifeq ($(shell pkg-config --exists libmariadb && echo yes),yes) -MYSQL_CFLAGS := $(shell pkg-config --cflags libmariadb) +MYSQL_CFLAGS := $(shell pkg-config --cflags libmariadb) -DMARIADB=1 MYSQL_LDFLAGS := $(shell pkg-config --libs libmariadb) else ifneq ($(shell which mariadb_config),) -MYSQL_CFLAGS := $(shell mariadb_config --cflags) +MYSQL_CFLAGS := $(shell mariadb_config --cflags) -DMARIADB=1 MYSQL_LDFLAGS := $(shell mariadb_config --libs) else ifneq ($(shell which mysql_config),) MYSQL_CFLAGS := $(shell mysql_config --cflags) diff --git a/medmysql.c b/medmysql.c index 386e166..d74cf64 100644 --- a/medmysql.c +++ b/medmysql.c @@ -1,7 +1,12 @@ #include #include +#ifdef MARIADB +#include +#include +#else #include #include +#endif #include #include "medmysql.h"