Permalink
Browse files

Hide Jansson symbols in Avro library

The Avro C library embeds a copy of the Jansson library for handling
JSON values.  Unfortunately, the build scripts include all of the
Jansson symbols in the publically exported API of libavro.so.  That
gives us conflicts if we try to link with both libavro and a separately
installed copy of libjansson.so.  This patch updates our embedded copy
of Jansson to hide its symbols, so that they're only visible within
libavro.so.
  • Loading branch information...
1 parent bce120d commit cb48cec757207b6e86f8479b7dd349e64c7a7f1d Douglas Creager committed Jun 7, 2012
Showing with 8 additions and 0 deletions.
  1. +4 −0 lang/c/jansson/src/jansson.h
  2. +4 −0 lang/c/jansson/src/jansson_private.h
View
4 lang/c/jansson/src/jansson.h
@@ -18,6 +18,8 @@
extern "C" {
#endif
+#pragma GCC visibility push(hidden)
+
/* version */
#define JANSSON_MAJOR_VERSION 2
@@ -246,6 +248,8 @@ typedef void (*json_free_t)(void *);
void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn);
+#pragma GCC visibility pop
+
#ifdef __cplusplus
}
#endif
View
4 lang/c/jansson/src/jansson_private.h
@@ -18,6 +18,8 @@ extern "C" {
#include "jansson.h"
#include "hashtable.h"
+#pragma GCC visibility push(hidden)
+
#ifdef _WIN32
#define snprintf _snprintf
#endif
@@ -98,5 +100,7 @@ void* jsonp_malloc(size_t size);
void jsonp_free(void *ptr);
char *jsonp_strdup(const char *str);
+#pragma GCC visibility pop
+
CLOSE_EXTERN
#endif

0 comments on commit cb48cec

Please sign in to comment.