From 373e85a713352ca0d43fa8cfcdf80d19e6d2a206 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 19 Nov 2007 21:30:57 +0000 Subject: [PATCH] Fix static extern C compilation errors for Perl C++ wrappers git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10151 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 3 +++ Source/Modules/perl5.cxx | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGES.current b/CHANGES.current index ba71b74ee..3b72d520b 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,9 @@ Version 1.3.33 (in progress) ============================ +11/19/2007: wsfulton + [Perl] Fix broken compilation of C++ wrappers on some compilers. + 11/16/2007: olly [Python] Don't pass Py_ssize_t for a %d printf-like format as that's undefined behaviour when sizeof(Py_ssize_t) != sizeof(int). diff --git a/Source/Modules/perl5.cxx b/Source/Modules/perl5.cxx index e4fe0847d..67192959b 100644 --- a/Source/Modules/perl5.cxx +++ b/Source/Modules/perl5.cxx @@ -304,6 +304,7 @@ public: /* Start creating magic code */ Printv(magic, + "#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n", "#ifdef PERL_OBJECT\n", "#define MAGIC_CLASS _wrap_", module, "_var::\n", "class _wrap_", module, "_var : public CPerlObj {\n", @@ -324,6 +325,7 @@ public: /* Dump out variable wrappers */ Printv(magic, "\n\n#ifdef PERL_OBJECT\n", "};\n", "#endif\n", NIL); + Printv(magic, "\n#ifdef __cplusplus\n}\n#endif\n", NIL); Printf(f_header, "%s\n", magic);