add extern funcs declaration and casts for cimpiling C++ compiler
Merge pull request #1220 from arton/master

add extern funcs declaration and casts for cimpiling C++ compiler