Add C linkage

Change-Id: Icdf5602d396d2dc9d2d8bc87c4c0fe8f7dbbf3d2
Reviewed-on: http://review.couchbase.org/28921
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>