summaryrefslogtreecommitdiff
path: root/include/my_context.h
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 /include/my_context.h
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 'include/my_context.h')
-rw-r--r--include/my_context.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/my_context.h b/include/my_context.h
index 1e1b7e6a749..8ed0c0ccf4e 100644
--- a/include/my_context.h
+++ b/include/my_context.h
@@ -31,8 +31,10 @@
#define MY_CONTEXT_USE_X86_64_GCC_ASM
#elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__)
#define MY_CONTEXT_USE_I386_GCC_ASM
-#else
+#elif defined(HAVE_UCONTEXT)
#define MY_CONTEXT_USE_UCONTEXT
+#else
+#define MY_CONTEXT_DISABLE
#endif
#ifdef MY_CONTEXT_USE_WIN32_FIBERS
@@ -104,6 +106,13 @@ struct my_context {
#endif
+#ifdef MY_CONTEXT_DISABLE
+struct my_context {
+ int dummy;
+};
+#endif
+
+
/*
Initialize an asynchroneous context object.
Returns 0 on success, non-zero on failure.