aerospike / aerospike-client-c

Aerospike C Client
Other
97 stars 104 forks source link

Usage in C++ code requires wrapping headers in extern "C" #19

Closed bb-avn closed 9 years ago

bb-avn commented 9 years ago

We include the Aerospike client libraries in a C++ project. In order to avoid linker errors, every file that includes an #include directive for an Aerospike header needs to wrap those in an extern "C" block like this:

// Aerospike -- WARNING - extern "C" required!
extern "C" {
#include <aerospike/aerospike.h>
#include <aerospike/aerospike_key.h>
#include <aerospike/aerospike_query.h>
#include <aerospike/aerospike_lmap.h>
#include <aerospike/aerospike_index.h>
}

Could the Aerospike client library header files be made C++-safe by including this in the headers themselves?

BrianNichols commented 9 years ago

This will be added in the next C client release.

BrianNichols commented 9 years ago

Aerospike C client 3.1.0 has been released.