summaryrefslogtreecommitdiff
path: root/mysys/my_context.c
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2013-06-15 14:22:03 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2013-06-15 14:22:03 +0200
commit4b058643cd6396b46898380ba7fee5d583e18cfd (patch)
treea3fc883411b6d6d56b3250d6ce43e0b9096bcefc /mysys/my_context.c
parentb54a4b7621b4bdcc9846a968e4268ea71e88dab8 (diff)
downloadmariadb-git-4b058643cd6396b46898380ba7fee5d583e18cfd.tar.gz
MDEV-4601 : Allow MariaDB to be build without non-blocking client.
Non-blocking client currently can be build on Windows, GCC on i386 and x64, or any OS wth ucontext.h header. Prior to this patch, build failed if neither of these conditions is true. Fix to avoid compiler errors in these case - non-blocking API would not be useful on , but otherwise everything will work as before.
Diffstat (limited to 'mysys/my_context.c')
-rw-r--r--mysys/my_context.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/mysys/my_context.c b/mysys/my_context.c
index 08dc0920f21..9be5ab80468 100644
--- a/mysys/my_context.c
+++ b/mysys/my_context.c
@@ -726,3 +726,37 @@ my_context_continue(struct my_context *c)
}
#endif /* MY_CONTEXT_USE_WIN32_FIBERS */
+
+#ifdef MY_CONTEXT_DISABLE
+int
+my_context_continue(struct my_context *c)
+{
+ return -1;
+}
+
+
+int
+my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
+{
+ return -1;
+}
+
+
+int
+my_context_yield(struct my_context *c)
+{
+ return -1;
+}
+
+int
+my_context_init(struct my_context *c, size_t stack_size)
+{
+ return -1; /* Out of memory */
+}
+
+void
+my_context_destroy(struct my_context *c)
+{
+}
+
+#endif