summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2016-02-07 15:00:30 +0200
committerMonty <monty@mariadb.org>2016-02-07 15:00:30 +0200
commitd80b8442a68093106e00a9a38b7b2c593002a72c (patch)
tree17881f51bbc0fbe4b25d09d23e5a292a75a58298
parent07b8aefe90ca830d2de068f2966cd2288b158a88 (diff)
downloadmariadb-git-d80b8442a68093106e00a9a38b7b2c593002a72c.tar.gz
Fixes needed to compile with musl C library
Patch originally by Codarren Velvindron
-rw-r--r--configure.cmake1
-rw-r--r--include/my_net.h6
-rw-r--r--libmysql/libmysql.c6
-rw-r--r--storage/mroonga/vendor/groonga/lib/com.c4
-rw-r--r--storage/mroonga/vendor/groonga/lib/grn_com.h6
-rw-r--r--storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake2
-rw-r--r--strings/my_vsnprintf.c2
7 files changed, 18 insertions, 9 deletions
diff --git a/configure.cmake b/configure.cmake
index 203f49c1a0d..56d68e302d2 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -199,6 +199,7 @@ CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H)
CHECK_INCLUDE_FILES (paths.h HAVE_PATHS_H)
CHECK_INCLUDE_FILES (port.h HAVE_PORT_H)
CHECK_INCLUDE_FILES (poll.h HAVE_POLL_H)
+CHECK_INCLUDE_FILES (sys/poll.h HAVE_SYS_POLL_H)
CHECK_INCLUDE_FILES (pwd.h HAVE_PWD_H)
CHECK_INCLUDE_FILES (sched.h HAVE_SCHED_H)
CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H)
diff --git a/include/my_net.h b/include/my_net.h
index 1ebb71ead23..91d780a276d 100644
--- a/include/my_net.h
+++ b/include/my_net.h
@@ -36,9 +36,11 @@ C_MODE_START
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
-#ifdef HAVE_POLL
+#if defined(HAVE_POLL_H)
+#include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
#include <sys/poll.h>
-#endif
+#endif /* defined(HAVE_POLL_H) */
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 8af5a284b9a..69ddb155f52 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -47,9 +47,11 @@
#include <sys/select.h>
#endif
#endif /* !defined(__WIN__) */
-#ifdef HAVE_POLL
+#if defined(HAVE_POLL_H)
+#include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
#include <sys/poll.h>
-#endif
+#endif /* defined(HAVE_POLL_H) */
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
diff --git a/storage/mroonga/vendor/groonga/lib/com.c b/storage/mroonga/vendor/groonga/lib/com.c
index a7450ec31f0..a16a446022c 100644
--- a/storage/mroonga/vendor/groonga/lib/com.c
+++ b/storage/mroonga/vendor/groonga/lib/com.c
@@ -348,7 +348,7 @@ grn_com_event_add(grn_ctx *ctx, grn_com_event *ev, grn_sock fd, int events, grn_
struct epoll_event e;
memset(&e, 0, sizeof(struct epoll_event));
e.data.fd = (fd);
- e.events = (__uint32_t) events;
+ e.events = (uint32_t) events;
if (epoll_ctl(ev->epfd, EPOLL_CTL_ADD, (fd), &e) == -1) {
SERR("epoll_ctl");
return ctx->rc;
@@ -396,7 +396,7 @@ grn_com_event_mod(grn_ctx *ctx, grn_com_event *ev, grn_sock fd, int events, grn_
struct epoll_event e;
memset(&e, 0, sizeof(struct epoll_event));
e.data.fd = (fd);
- e.events = (__uint32_t) events;
+ e.events = (uint32_t) events;
if (epoll_ctl(ev->epfd, EPOLL_CTL_MOD, (fd), &e) == -1) {
SERR("epoll_ctl");
return ctx->rc;
diff --git a/storage/mroonga/vendor/groonga/lib/grn_com.h b/storage/mroonga/vendor/groonga/lib/grn_com.h
index 203ed56c88d..e5ad58981cf 100644
--- a/storage/mroonga/vendor/groonga/lib/grn_com.h
+++ b/storage/mroonga/vendor/groonga/lib/grn_com.h
@@ -83,7 +83,11 @@ GRN_API grn_com_queue_entry *grn_com_queue_deque(grn_ctx *ctx, grn_com_queue *q)
# define GRN_COM_POLLIN EVFILT_READ
# define GRN_COM_POLLOUT EVFILT_WRITE
# else /* USE_KQUEUE */
-# include <sys/poll.h>
+# if defined(HAVE_POLL_H)
+# include <poll.h>
+# elif defined(HAVE_SYS_POLL_H)
+# include <sys/poll.h>
+# endif /* defined(HAVE_POLL_H) */
# define GRN_COM_POLLIN POLLIN
# define GRN_COM_POLLOUT POLLOUT
# endif /* USE_KQUEUE */
diff --git a/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake b/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake
index 4c5004cd6a5..e3c900fbadb 100644
--- a/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake
+++ b/storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake
@@ -93,7 +93,7 @@ if (NOT HAVE_BACKTRACE_WITHOUT_EXECINFO)
if (HAVE_BACKTRACE_WITH_EXECINFO)
list(APPEND EXTRA_SYSTEM_LIBS execinfo)
else ()
- message(FATAL_ERROR "Cannot find backtrace(), even with -lexecinfo.")
+ message(WARNING "Cannot find backtrace(), even with -lexecinfo.")
endif ()
endif ()
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index 1584a9e2cef..4178b20789d 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -831,7 +831,7 @@ void my_strerror(char *buf, size_t len, int nr)
(defined _XOPEN_SOURCE && (_XOPEN_SOURCE >= 600))) && \
! defined _GNU_SOURCE
strerror_r(nr, buf, len); /* I can build with or without GNU */
-#elif defined _GNU_SOURCE
+#elif defined(__GLIBC__) && defined (_GNU_SOURCE)
char *r= strerror_r(nr, buf, len);
if (r != buf) /* Want to help, GNU? */
strmake(buf, r, len - 1); /* Then don't. */