libmysqlclient-6.1.6.patchset revision 5a2f0fde
1From 7340e870fc8846069b6e955161dd8f1a6fc0e3ed Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Adri=C3=A1n=20Arroyo=20Calle?=
3 <adrian.arroyocalle@gmail.com>
4Date: Wed, 29 Aug 2018 13:34:46 +0300
5Subject: Fix build on Haiku
6
7
8diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
9index ac28c62..c8bb883 100644
10--- a/extra/CMakeLists.txt
11+++ b/extra/CMakeLists.txt
12@@ -67,7 +67,7 @@ TARGET_LINK_LIBRARIES(perror mysys mysys_ssl)
13 SET_TARGET_PROPERTIES(perror PROPERTIES LINKER_LANGUAGE CXX)
14 
15 MYSQL_ADD_EXECUTABLE(resolveip EXCLUDE_FROM_ALL resolveip.c)
16-TARGET_LINK_LIBRARIES(resolveip mysys mysys_ssl)
17+TARGET_LINK_LIBRARIES(resolveip mysys mysys_ssl network)
18 SET_TARGET_PROPERTIES(resolveip PROPERTIES LINKER_LANGUAGE CXX)
19 IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
20   INCLUDE(CheckFunctionExists)
21diff --git a/include/my_sys.h b/include/my_sys.h
22index 89011a8..3fe6e9d 100644
23--- a/include/my_sys.h
24+++ b/include/my_sys.h
25@@ -16,6 +16,7 @@
26 #ifndef _my_sys_h
27 #define _my_sys_h
28 
29+#include <sys/time.h>
30 #include "my_global.h"                  /* C_MODE_START, C_MODE_END */
31 #include "my_pthread.h"
32 #include "m_ctype.h"                    /* for CHARSET_INFO */
33@@ -26,9 +27,7 @@
34 #ifdef _WIN32
35 #include <malloc.h>
36 #endif
37-#ifdef HAVE_UNISTD_H
38 #include <unistd.h>
39-#endif
40 
41 C_MODE_START
42 
43diff --git a/include/my_time.h b/include/my_time.h
44index 90452f0..b791417 100644
45--- a/include/my_time.h
46+++ b/include/my_time.h
47@@ -17,6 +17,7 @@
48   This is a private header of sql-common library, containing
49   declarations for my_time.c
50 */
51+#include <sys/time.h>
52 
53 #ifndef _my_time_h_
54 #define _my_time_h_
55diff --git a/mysys/my_getsystime.c b/mysys/my_getsystime.c
56index 3007c4e..1cd4446 100644
57--- a/mysys/my_getsystime.c
58+++ b/mysys/my_getsystime.c
59@@ -17,12 +17,12 @@
60 /* thus to get the current time we should use the system function
61    with the highest possible resolution */
62 
63+#include <sys/time.h>
64+
65 #include "mysys_priv.h"
66 #include "my_static.h"
67 
68-#if HAVE_SYS_TIME_H
69-#include <sys/time.h>
70-#endif
71+
72 
73 /**
74   Get high-resolution time.
75diff --git a/mysys/my_init.c b/mysys/my_init.c
76index c0ba3ae..c3ac341 100644
77--- a/mysys/my_init.c
78+++ b/mysys/my_init.c
79@@ -12,6 +12,8 @@
80    You should have received a copy of the GNU General Public License
81    along with this program; if not, write to the Free Software
82    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
83+#include <sys/time.h>
84+#include <sys/resource.h>
85 
86 #include "mysys_priv.h"
87 #include "my_static.h"
88@@ -19,10 +21,6 @@
89 #include "m_string.h"
90 #include "mysql/psi/mysql_stage.h"
91 
92-#ifdef HAVE_SYS_RESOURCE_H
93-#include <sys/resource.h>
94-#endif
95-
96 #ifdef _WIN32
97 #include <locale.h>
98 #include <crtdbg.h>
99@@ -187,25 +185,6 @@ void my_end(int infoflag)
100 
101   if ((infoflag & MY_GIVE_INFO) || print_info)
102   {
103-#ifdef HAVE_GETRUSAGE
104-    struct rusage rus;
105-    if (!getrusage(RUSAGE_SELF, &rus))
106-      fprintf(info_file,"\n\
107-User time %.2f, System time %.2f\n\
108-Maximum resident set size %ld, Integral resident set size %ld\n\
109-Non-physical pagefaults %ld, Physical pagefaults %ld, Swaps %ld\n\
110-Blocks in %ld out %ld, Messages in %ld out %ld, Signals %ld\n\
111-Voluntary context switches %ld, Involuntary context switches %ld\n",
112-	      (rus.ru_utime.tv_sec * SCALE_SEC +
113-	       rus.ru_utime.tv_usec / SCALE_USEC) / 100.0,
114-	      (rus.ru_stime.tv_sec * SCALE_SEC +
115-	       rus.ru_stime.tv_usec / SCALE_USEC) / 100.0,
116-	      rus.ru_maxrss, rus.ru_idrss,
117-	      rus.ru_minflt, rus.ru_majflt,
118-	      rus.ru_nswap, rus.ru_inblock, rus.ru_oublock,
119-	      rus.ru_msgsnd, rus.ru_msgrcv, rus.ru_nsignals,
120-	      rus.ru_nvcsw, rus.ru_nivcsw);
121-#endif
122 #if defined(_WIN32) && defined(_MSC_VER)
123    _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
124    _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR );
125diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
126index cb8599d..49d8e3f 100644
127--- a/tests/CMakeLists.txt
128+++ b/tests/CMakeLists.txt
129@@ -18,7 +18,7 @@ ADD_DEFINITIONS("-DMYSQL_CLIENT")
130 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
131 
132 ADD_EXECUTABLE(mysql_client_test mysql_client_test.c)
133-TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient)
134+TARGET_LINK_LIBRARIES(mysql_client_test mysqlclient network)
135 SET_TARGET_PROPERTIES(mysql_client_test PROPERTIES LINKER_LANGUAGE CXX)
136 
137 #
138-- 
1392.24.0
140
141
142From 0124d20f7f0c26d57c7a44598977b86081714520 Mon Sep 17 00:00:00 2001
143From: begasus <begasus@gmail.com>
144Date: Sat, 9 Nov 2019 17:41:18 +0100
145Subject: 32bit fixes for int32, uint32
146
147
148diff --git a/extra/resolveip.c b/extra/resolveip.c
149index 54ce3eb..2f505dc 100644
150--- a/extra/resolveip.c
151+++ b/extra/resolveip.c
152@@ -41,7 +41,11 @@
153 extern int h_errno;
154 #endif
155 
156+#if defined(__HAIKU__)
157+#include <SupportDefs.h>
158+#else
159 typedef uint32 in_addr_t;
160+#endif
161 
162 static my_bool silent;
163 
164diff --git a/include/my_global.h b/include/my_global.h
165index acadb44..b95c02b 100644
166--- a/include/my_global.h
167+++ b/include/my_global.h
168@@ -458,8 +458,12 @@ typedef unsigned char uint8;    /* Unsigned integer >= 8  bits */
169 typedef short int16;
170 typedef unsigned short uint16;
171 #if SIZEOF_INT == 4
172+#if defined(__HAIKU__)
173+#include <SupportDefs.h>
174+#else
175 typedef int int32;
176 typedef unsigned int uint32;
177+#endif
178 #elif SIZEOF_LONG == 4
179 typedef long int32;
180 typedef unsigned long uint32;
181-- 
1822.24.0
183
184
185From 860d4df086c1762169c6a9c87e1996f6d7a4767e Mon Sep 17 00:00:00 2001
186From: begasus <begasus@gmail.com>
187Date: Sat, 9 Nov 2019 17:45:50 +0100
188Subject: 64bit fix for int64, uint64
189
190
191diff --git a/include/my_global.h b/include/my_global.h
192index b95c02b..baff70a 100644
193--- a/include/my_global.h
194+++ b/include/my_global.h
195@@ -481,8 +481,12 @@ typedef unsigned long	ulong;		  /* Short for unsigned long */
196 */
197 typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
198 typedef long long int	longlong;
199+#if defined(__HAIKU__)
200+#include <SupportDefs.h>
201+#else
202 typedef longlong int64;
203 typedef ulonglong uint64;
204+#endif
205 
206 #if defined (_WIN32)
207 typedef unsigned __int64 my_ulonglong;
208-- 
2092.24.0
210
211
212From 5692920f18f8419a21dbca3df87d676c085a933d Mon Sep 17 00:00:00 2001
213From: begasus <begasus@gmail.com>
214Date: Sat, 9 Nov 2019 20:45:49 +0100
215Subject: Add -lnetwork search
216
217
218diff --git a/configure.cmake b/configure.cmake
219index a4f5e8f..5052084 100644
220--- a/configure.cmake
221+++ b/configure.cmake
222@@ -308,6 +308,7 @@ IF(UNIX)
223   MY_SEARCH_LIBS(bind "bind;socket" LIBBIND)
224   MY_SEARCH_LIBS(crypt crypt LIBCRYPT)
225   MY_SEARCH_LIBS(setsockopt socket LIBSOCKET)
226+  MY_SEARCH_LIBS(socket network LIBNETWORK)
227   MY_SEARCH_LIBS(dlopen dl LIBDL)
228   MY_SEARCH_LIBS(sched_yield rt LIBRT)
229   IF(NOT LIBRT)
230@@ -316,7 +317,7 @@ IF(UNIX)
231   MY_SEARCH_LIBS(timer_create rt LIBRT)
232 
233   SET(CMAKE_REQUIRED_LIBRARIES 
234-    ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT})
235+    ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${LIBNETWORK} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT})
236   # Need explicit pthread for gcc -fsanitize=address
237   IF(CMAKE_C_FLAGS MATCHES "-fsanitize=")
238     SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} pthread)
239-- 
2402.24.0
241
242