There is no need to redefine __BEGIN_DECLS and __END_DECLS. We simplify the logic here and avoid undefining these macros.