#endif
#ifdef USE_PERLIO
-PERL_EXPORT_C void PerlIO_teardown(pTHX);
+EXTERN_C void PerlIO_teardown(pTHX);
# ifdef USE_ITHREADS
# define PERLIO_INIT MUTEX_INIT(&PL_perlio_mutex)
# define PERLIO_TERM \
PERL_EXPORT_C void PerlIO_list_free(pTHX_ PerlIO_list_t *list);
PERL_EXPORT_C void PerlIO_list_push(pTHX_ PerlIO_list_t *list, PerlIO_funcs *funcs, SV *arg);
PERL_EXPORT_C void PerlIO_list_free(pTHX_ PerlIO_list_t *list);
-PERL_EXPORT_C void PerlIO_teardown(pTHX);
+
+/* PerlIO_teardown doesn't need exporting, but the EXTERN_C is needed
+ * for compiling as C++. Must also match with what perl.h says. */
+EXTERN_C void PerlIO_teardown(pTHX);
/*--------------------------------------------------------------------------------------*/
/* Generic, or stub layer functions */