summaryrefslogtreecommitdiff
path: root/ext/compressors
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2014-06-20 15:38:18 +1000
committerAlex Gorrod <alexg@wiredtiger.com>2014-06-20 15:38:18 +1000
commit943f4907387495903bc2fa5a52ed01785e0d8948 (patch)
tree32183b51c56a98173f10112d6ccc8087aac0334f /ext/compressors
parentdf96872152325680f309c6a32cfc66af43081bc8 (diff)
downloadmongo-943f4907387495903bc2fa5a52ed01785e0d8948.tar.gz
Update the API exposed by extensions that can be builtin.
Otherwise multiple builtin extensions will conflict on the wiredtiger_extension_init function.
Diffstat (limited to 'ext/compressors')
-rw-r--r--ext/compressors/snappy/snappy_compress.c12
-rw-r--r--ext/compressors/zlib/zlib_compress.c12
2 files changed, 24 insertions, 0 deletions
diff --git a/ext/compressors/snappy/snappy_compress.c b/ext/compressors/snappy/snappy_compress.c
index 656f0e7a664..bece436d6e4 100644
--- a/ext/compressors/snappy/snappy_compress.c
+++ b/ext/compressors/snappy/snappy_compress.c
@@ -33,6 +33,12 @@
#include <wiredtiger.h>
#include <wiredtiger_ext.h>
+/*
+ * We need to include the configuration file to detect whether this extension
+ * is being built into the WiredTiger library.
+ */
+#include "wiredtiger_config.h"
+
/* Local compressor structure. */
typedef struct {
WT_COMPRESSOR compressor; /* Must come first */
@@ -219,6 +225,11 @@ snappy_extension_init(WT_CONNECTION *connection, WT_CONFIG_ARG *config)
}
/*
+ * We have to remove this symbol when building as a builtin extension otherwise
+ * it will conflict with other builtin libraries.
+ */
+#ifndef HAVE_BUILTIN_EXTENSION_SNAPPY
+/*
* wiredtiger_extension_init --
* WiredTiger snappy compression extension.
*/
@@ -227,3 +238,4 @@ wiredtiger_extension_init(WT_CONNECTION *connection, WT_CONFIG_ARG *config)
{
return snappy_extension_init(connection, config);
}
+#endif
diff --git a/ext/compressors/zlib/zlib_compress.c b/ext/compressors/zlib/zlib_compress.c
index 2ecec81f996..33bb9bf8810 100644
--- a/ext/compressors/zlib/zlib_compress.c
+++ b/ext/compressors/zlib/zlib_compress.c
@@ -34,6 +34,12 @@
#include <wiredtiger.h>
#include <wiredtiger_ext.h>
+/*
+ * We need to include the configuration file to detect whether this extension
+ * is being built into the WiredTiger library.
+ */
+#include "wiredtiger_config.h"
+
/* Local compressor structure. */
typedef struct {
WT_COMPRESSOR compressor; /* Must come first */
@@ -393,6 +399,11 @@ zlib_extension_init(
}
/*
+ * We have to remove this symbol when building as a builtin extension otherwise
+ * it will conflict with other builtin libraries.
+ */
+#ifndef HAVE_BUILTIN_EXTENSION_SNAPPY
+/*
* wiredtiger_extension_init --
* WiredTiger zlib compression extension.
*/
@@ -402,3 +413,4 @@ wiredtiger_extension_init(
{
return (zlib_extension_init(connection, config));
}
+#endif