ClickHouse/libs/libmysqlxx/include/mysqlxx/Types.h
Rafael David Tinoco 17a7cb8735 MySQL 8 integration requires previous declaration checks
C and C++ differ in the form of types being defined. While C++ structs
are defined also as new types, in C you have to explicitly typedef the
struct to have a new type.

Fir this case, it was enough to check if MySQL header was already
defined in order not to re-declare MYSQL, MYSQL_RES, MYSQL_ROW and
MYSQL_FIELD.

Signed-off-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com>
2019-08-20 09:48:50 -03:00

34 lines
492 B
C++

#pragma once
#include <cstdint>
#include <string>
#ifndef _mysql_h
struct st_mysql;
using MYSQL = st_mysql;
struct st_mysql_res;
using MYSQL_RES = st_mysql_res;
using MYSQL_ROW = char**;
struct st_mysql_field;
using MYSQL_FIELD = st_mysql_field;
#endif
namespace mysqlxx
{
using UInt64 = uint64_t;
using Int64 = int64_t;
using UInt32 = uint32_t;
using Int32 = int32_t;
using MYSQL_LENGTH = unsigned long;
using MYSQL_LENGTHS = MYSQL_LENGTH *;
using MYSQL_FIELDS = MYSQL_FIELD *;
}