You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
Build fixes:
- Fixed build error, which was previously introduced by commit
c8ca89112e
- Treat warnings as errors
This commit is contained in:
@@ -99,8 +99,6 @@ IF(MSVC)
|
|||||||
INCLUDE(${CC_SOURCE_DIR}/cmake/WindowsCache.cmake)
|
INCLUDE(${CC_SOURCE_DIR}/cmake/WindowsCache.cmake)
|
||||||
ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN -DNOGDI)
|
ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN -DNOGDI)
|
||||||
IF (MSVC)
|
IF (MSVC)
|
||||||
# Treat warnings as errors
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -WX")
|
|
||||||
SET(CONFIG_TYPES "DEBUG" "RELEASE" "RELWITHDEBINFO")
|
SET(CONFIG_TYPES "DEBUG" "RELEASE" "RELWITHDEBINFO")
|
||||||
FOREACH(BUILD_TYPE ${CONFIG_TYPES})
|
FOREACH(BUILD_TYPE ${CONFIG_TYPES})
|
||||||
FOREACH(COMPILER CXX C)
|
FOREACH(COMPILER CXX C)
|
||||||
@@ -144,6 +142,13 @@ IF(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
ENDFOREACH()
|
ENDFOREACH()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF (CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||||
|
SET(WARNING_AS_ERROR "-Werror" CACHE INTERNAL "WARNING_AS_ERROR")
|
||||||
|
ELSEIF(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||||
|
SET(WARNING_AS_ERROR "/WX" CACHE INTERNAL "WARNING_AS_ERROR")
|
||||||
|
ENDIF()
|
||||||
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_AS_ERROR}")
|
||||||
|
|
||||||
# If the build type isn't specified, set to Relwithdebinfo as default.
|
# If the build type isn't specified, set to Relwithdebinfo as default.
|
||||||
IF(NOT CMAKE_BUILD_TYPE)
|
IF(NOT CMAKE_BUILD_TYPE)
|
||||||
SET(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
SET(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
||||||
|
3
external/zlib/CMakeLists.txt
vendored
3
external/zlib/CMakeLists.txt
vendored
@@ -5,6 +5,9 @@ project(zlib C)
|
|||||||
|
|
||||||
set(VERSION "1.2.13")
|
set(VERSION "1.2.13")
|
||||||
|
|
||||||
|
# Don't treat warnings as error for zlib
|
||||||
|
STRING(REPLACE ${WARNING_AS_ERROR} "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
|
||||||
|
|
||||||
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
|
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
|
||||||
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
|
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
|
||||||
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
|
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#define strcasecmp _stricmp
|
#define strcasecmp _stricmp
|
||||||
#define strtok_r strtok_s
|
#define strtok_r strtok_s
|
||||||
|
#define strdup _strdup
|
||||||
#define sleep(x) Sleep(1000*(x))
|
#define sleep(x) Sleep(1000*(x))
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#define inline __inline
|
#define inline __inline
|
||||||
|
@@ -29,6 +29,8 @@
|
|||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include "shlwapi.h"
|
#include "shlwapi.h"
|
||||||
|
|
||||||
|
#define access _access
|
||||||
|
|
||||||
static const char *ini_exts[]= {"ini", "cnf", 0};
|
static const char *ini_exts[]= {"ini", "cnf", 0};
|
||||||
#define R_OK 4
|
#define R_OK 4
|
||||||
#else
|
#else
|
||||||
|
@@ -962,7 +962,7 @@ static uint8_t mariadb_rpl_send_semisync_ack(MARIADB_RPL* rpl, MARIADB_RPL_EVENT
|
|||||||
rpl_set_error(rpl, CR_BINLOG_SEMI_SYNC_ERROR, 0, "semi synchronous replication is not enabled");
|
rpl_set_error(rpl, CR_BINLOG_SEMI_SYNC_ERROR, 0, "semi synchronous replication is not enabled");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (!event->is_semi_sync || !event->semi_sync_flags != SEMI_SYNC_ACK_REQ)
|
if (!event->is_semi_sync || (event->semi_sync_flags != SEMI_SYNC_ACK_REQ))
|
||||||
{
|
{
|
||||||
rpl_set_error(rpl, CR_BINLOG_SEMI_SYNC_ERROR, 0, "This event doesn't require to send semi synchronous acknoledgement");
|
rpl_set_error(rpl, CR_BINLOG_SEMI_SYNC_ERROR, 0, "This event doesn't require to send semi synchronous acknoledgement");
|
||||||
return 1;
|
return 1;
|
||||||
@@ -972,7 +972,7 @@ static uint8_t mariadb_rpl_send_semisync_ack(MARIADB_RPL* rpl, MARIADB_RPL_EVENT
|
|||||||
buf = alloca(buf_size);
|
buf = alloca(buf_size);
|
||||||
|
|
||||||
buf[0] = SEMI_SYNC_INDICATOR;
|
buf[0] = SEMI_SYNC_INDICATOR;
|
||||||
int8store(buf + 1, event->next_event_pos);
|
int8store(buf + 1, (uint64_t)event->next_event_pos);
|
||||||
memcpy(buf + 9, rpl->filename, rpl->filename_length);
|
memcpy(buf + 9, rpl->filename, rpl->filename_length);
|
||||||
|
|
||||||
ma_net_clear(&rpl->mysql->net);
|
ma_net_clear(&rpl->mysql->net);
|
||||||
@@ -2084,6 +2084,7 @@ int STDCALL mariadb_rpl_get_optionsv(MARIADB_RPL *rpl,
|
|||||||
{
|
{
|
||||||
unsigned int* semi_sync = va_arg(ap, unsigned int*);
|
unsigned int* semi_sync = va_arg(ap, unsigned int*);
|
||||||
*semi_sync = rpl->is_semi_sync;
|
*semi_sync = rpl->is_semi_sync;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@@ -121,11 +121,7 @@ extern int _getopt_internal (int argc, char *const *argv,
|
|||||||
const struct option *longopts, int *longind,
|
const struct option *longopts, int *longind,
|
||||||
int long_only);
|
int long_only);
|
||||||
#else /* not __STDC__ */
|
#else /* not __STDC__ */
|
||||||
extern int getopt ();
|
extern int getopt (int argc, char *const *argv, const char *optstring);
|
||||||
extern int getopt_long ();
|
|
||||||
extern int getopt_long_only ();
|
|
||||||
|
|
||||||
extern int _getopt_internal ();
|
|
||||||
#endif /* __STDC__ */
|
#endif /* __STDC__ */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@@ -38,6 +38,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#else
|
#else
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
#define unlink _unlink
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef OK
|
#ifndef OK
|
||||||
|
@@ -342,9 +342,9 @@ static int test_conc592(MYSQL *my __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct my_tests_st my_tests[] = {
|
struct my_tests_st my_tests[] = {
|
||||||
// {"test_conc592", test_conc592, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
{"test_conc592", test_conc592, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||||
//{"test_rpl_async", test_rpl_async, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
{"test_rpl_async", test_rpl_async, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||||
//{"test_rpl_semisync", test_rpl_semisync, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
{"test_rpl_semisync", test_rpl_semisync, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||||
{"test_conc467", test_conc467, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
{"test_conc467", test_conc467, TEST_CONNECTION_NEW, 0, NULL, NULL},
|
||||||
{NULL, NULL, 0, 0, NULL, NULL}
|
{NULL, NULL, 0, 0, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user