add extern c linkage when compiling against c++