Add G_BEGIN_DECLS and G_END_DECLS macros for prototypes to fix c++ linkage