From 6b26ca69d57a6a48c2bd5520244e0b643a593d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Arroyo=20Calle?= Date: Mon, 4 Jan 2016 19:18:46 +0000 Subject: Fix build on Haiku diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt index ac28c62..2a8abf7 100644 --- a/extra/CMakeLists.txt +++ b/extra/CMakeLists.txt @@ -1,20 +1,20 @@ # Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA INCLUDE_DIRECTORIES( -${CMAKE_SOURCE_DIR}/include +${CMAKE_SOURCE_DIR}/include ${ZLIB_INCLUDE_DIR}) # Default install component for the files here @@ -27,12 +27,12 @@ IF(NOT CMAKE_CROSSCOMPILING) ENDIF() -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/include/mysqld_error.h +ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/include/mysqld_error.h ${PROJECT_BINARY_DIR}/sql/share/english/errmsg.sys COMMAND comp_err - --charset=${PROJECT_SOURCE_DIR}/sql/share/charsets + --charset=${PROJECT_SOURCE_DIR}/sql/share/charsets --out-dir=${PROJECT_BINARY_DIR}/sql/share/ - --header_file=${PROJECT_BINARY_DIR}/include/mysqld_error.h + --header_file=${PROJECT_BINARY_DIR}/include/mysqld_error.h --name_file=${PROJECT_BINARY_DIR}/include/mysqld_ername.h --state_file=${PROJECT_BINARY_DIR}/include/sql_state.h --in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt @@ -41,9 +41,9 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/include/mysqld_error.h ADD_CUSTOM_TARGET(GenError ALL - DEPENDS + DEPENDS ${PROJECT_BINARY_DIR}/include/mysqld_error.h - ${PROJECT_BINARY_DIR}/sql/share/english/errmsg.sys + ${PROJECT_BINARY_DIR}/sql/share/english/errmsg.sys ${PROJECT_SOURCE_DIR}/sql/share/errmsg-utf8.txt) # Set InnoDB mutex type @@ -67,7 +67,7 @@ TARGET_LINK_LIBRARIES(perror mysys mysys_ssl) SET_TARGET_PROPERTIES(perror PROPERTIES LINKER_LANGUAGE CXX) MYSQL_ADD_EXECUTABLE(resolveip EXCLUDE_FROM_ALL resolveip.c) -TARGET_LINK_LIBRARIES(resolveip mysys mysys_ssl) +TARGET_LINK_LIBRARIES(resolveip mysys mysys_ssl network) SET_TARGET_PROPERTIES(resolveip PROPERTIES LINKER_LANGUAGE CXX) IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") INCLUDE(CheckFunctionExists) diff --git a/include/my_sys.h b/include/my_sys.h index 89011a8..81aaa91 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -12,10 +12,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - +//#undef __cplusplus #ifndef _my_sys_h #define _my_sys_h +#include #include "my_global.h" /* C_MODE_START, C_MODE_END */ #include "my_pthread.h" #include "m_ctype.h" /* for CHARSET_INFO */ @@ -26,9 +27,7 @@ #ifdef _WIN32 #include #endif -#ifdef HAVE_UNISTD_H #include -#endif C_MODE_START @@ -475,7 +474,7 @@ extern my_error_reporter my_charset_error_reporter; #define my_b_tell(info) ((info)->pos_in_file + \ (size_t) (*(info)->current_pos - (info)->request_pos)) -#define my_b_get_buffer_start(info) (info)->request_pos +#define my_b_get_buffer_start(info) (info)->request_pos #define my_b_get_bytes_in_buffer(info) (char*) (info)->read_end - \ (char*) my_b_get_buffer_start(info) #define my_b_get_pos_in_file(info) (info)->pos_in_file @@ -573,7 +572,7 @@ extern my_bool is_filename_allowed(const char *name, size_t length, my_bool allow_current_dir); #else /* _WIN32 */ # define is_filename_allowed(name, length, allow_cwd) (TRUE) -#endif /* _WIN32 */ +#endif /* _WIN32 */ #ifdef _WIN32 extern int nt_share_delete(const char *name,myf MyFlags); diff --git a/include/my_time.h b/include/my_time.h index 90452f0..e0dd580 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -17,6 +17,7 @@ This is a private header of sql-common library, containing declarations for my_time.c */ +#include #ifndef _my_time_h_ #define _my_time_h_ @@ -192,7 +193,7 @@ static inline my_bool validate_timestamp_range(const MYSQL_TIME *t) return TRUE; } -my_time_t +my_time_t my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, my_bool *in_dst_time_gap); @@ -217,18 +218,18 @@ int my_TIME_to_str(const MYSQL_TIME *l_time, char *to, uint dec); int my_timeval_to_str(const struct timeval *tm, char *to, uint dec); -/* +/* Available interval types used in any statement. 'interval_type' must be sorted so that simple intervals comes first, ie year, quarter, month, week, day, hour, etc. The order based on interval size is also important and the intervals should be kept in a large to smaller order. (get_interval_value() depends on this) - - Note: If you change the order of elements in this enum you should fix - order of elements in 'interval_type_to_name' and 'interval_names' - arrays - + + Note: If you change the order of elements in this enum you should fix + order of elements in 'interval_type_to_name' and 'interval_names' + arrays + See also interval_type_to_name, get_interval_value, interval_names */ diff --git a/mysys/my_getsystime.c b/mysys/my_getsystime.c index 3007c4e..1cd4446 100644 --- a/mysys/my_getsystime.c +++ b/mysys/my_getsystime.c @@ -17,12 +17,12 @@ /* thus to get the current time we should use the system function with the highest possible resolution */ +#include + #include "mysys_priv.h" #include "my_static.h" -#if HAVE_SYS_TIME_H -#include -#endif + /** Get high-resolution time. diff --git a/mysys/my_init.c b/mysys/my_init.c index c0ba3ae..72ab88f 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -12,6 +12,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include +#include #include "mysys_priv.h" #include "my_static.h" @@ -19,10 +21,6 @@ #include "m_string.h" #include "mysql/psi/mysql_stage.h" -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif - #ifdef _WIN32 #include #include @@ -187,25 +185,6 @@ void my_end(int infoflag) if ((infoflag & MY_GIVE_INFO) || print_info) { -#ifdef HAVE_GETRUSAGE - struct rusage rus; - if (!getrusage(RUSAGE_SELF, &rus)) - fprintf(info_file,"\n\ -User time %.2f, System time %.2f\n\ -Maximum resident set size %ld, Integral resident set size %ld\n\ -Non-physical pagefaults %ld, Physical pagefaults %ld, Swaps %ld\n\ -Blocks in %ld out %ld, Messages in %ld out %ld, Signals %ld\n\ -Voluntary context switches %ld, Involuntary context switches %ld\n", - (rus.ru_utime.tv_sec * SCALE_SEC + - rus.ru_utime.tv_usec / SCALE_USEC) / 100.0, - (rus.ru_stime.tv_sec * SCALE_SEC + - rus.ru_stime.tv_usec / SCALE_USEC) / 100.0, - rus.ru_maxrss, rus.ru_idrss, - rus.ru_minflt, rus.ru_majflt, - rus.ru_nswap, rus.ru_inblock, rus.ru_oublock, - rus.ru_msgsnd, rus.ru_msgrcv, rus.ru_nsignals, - rus.ru_nvcsw, rus.ru_nivcsw); -#endif #if defined(_WIN32) && defined(_MSC_VER) _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR ); @@ -240,7 +219,7 @@ Voluntary context switches %ld, Involuntary context switches %ld\n", /* my_parameter_handler - + Invalid parameter handler we will use instead of the one "baked" into the CRT for MSC v8. This one just prints out what invalid parameter was encountered. By providing this routine, routines like diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index cb8599d..a761626 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,14 +1,14 @@ # Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -18,11 +18,11 @@ ADD_DEFINITIONS("-DMYSQL_CLIENT") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) ADD_EXECUTABLE(mysql_client_test mysql_client_test.c) -TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient) +TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient network) SET_TARGET_PROPERTIES(mysql_client_test PROPERTIES LINKER_LANGUAGE CXX) # -# We do not distribute mysql_client_test nor install it in the system - it is +# We do not distribute mysql_client_test nor install it in the system - it is # only used to test the library when building it from sources. # #INSTALL(TARGETS mysql_client_test DESTINATION ${INSTALL_BINDIR} COMPONENT Test) -- 2.2.2