Fix Octave C support by adding extern "C" around header section. Fix Octave examples (simple, contract, variables, pointer, funcptr) such that example.c files are built with C compiler, and wrappers with C++ compiler.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10299 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Xavier Delacour 2008-03-05 15:29:01 +00:00
commit 13c0b040fc
11 changed files with 83 additions and 51 deletions

View file

@ -998,7 +998,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
if (depend) {
String *outfile;
if (!outfile_name) {
if (CPlusPlus) {
if (CPlusPlus || lang->cplus_runtime_mode()) {
outfile = NewStringf("%s_wrap.%s", Swig_file_basename(input_file), cpp_extension);
} else {
outfile = NewStringf("%s_wrap.c", Swig_file_basename(input_file));
@ -1116,7 +1116,7 @@ int SWIG_main(int argc, char *argv[], Language *l) {
/* Set some filename information on the object */
Setattr(top, "infile", input_file);
if (!outfile_name) {
if (CPlusPlus) {
if (CPlusPlus || lang->cplus_runtime_mode()) {
Setattr(top, "outfile", NewStringf("%s_wrap.%s", Swig_file_basename(input_file), cpp_extension));
} else {
Setattr(top, "outfile", NewStringf("%s_wrap.c", Swig_file_basename(input_file)));