Fix C++ support

Without extern "C" definition a C++ program cannot link to the libsoc.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>