Update kernel.c

wrapped the entire thing in extern "C" if compiling with C++, don't know why you would though.... since it's C code anyway.
Merge pull request #1 from brpylko/patch-1

added extern "C" wrapper within #ifdefs