Re-apply c.cxx changes from r11187
From: William S Fulton <wsf@fultondesigns.co.uk> git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@13038 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
994cf6f0c7
commit
cebb2aaa93
1 changed files with 17 additions and 3 deletions
|
|
@ -12,6 +12,20 @@ char cvsroot_c_cxx[] = "$Id: c.cxx 11186 2009-04-11 10:46:13Z maciekd $";
|
|||
#include <ctype.h>
|
||||
#include "swigmod.h"
|
||||
|
||||
int SwigType_isbuiltin(SwigType *t) {
|
||||
const char* builtins[] = { "void", "short", "int", "long", "char", "float", "double", "bool", 0 };
|
||||
int i = 0;
|
||||
char *c = Char(t);
|
||||
if (!t)
|
||||
return 0;
|
||||
while (builtins[i]) {
|
||||
if (strcmp(c, builtins[i]) == 0)
|
||||
return 1;
|
||||
i++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
class C:public Language {
|
||||
static const char *usage;
|
||||
|
||||
|
|
@ -150,7 +164,7 @@ public:
|
|||
String *outfile = Getattr(n, "outfile");
|
||||
|
||||
// initialize I/O
|
||||
f_runtime = NewFile(outfile, "w");
|
||||
f_runtime = NewFile(outfile, "w", SWIG_output_files());
|
||||
if (!f_runtime) {
|
||||
FileErrorDisplay(outfile);
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
|
|
@ -170,13 +184,13 @@ public:
|
|||
|
||||
// create proxy files with appropriate name
|
||||
String *proxy_code_filename = NewStringf("%s%s_proxy.c", SWIG_output_directory(), Char(module));
|
||||
if ((f_proxy_c = NewFile(proxy_code_filename, "w")) == 0) {
|
||||
if ((f_proxy_c = NewFile(proxy_code_filename, "w", SWIG_output_files())) == 0) {
|
||||
FileErrorDisplay(proxy_code_filename);
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
String *proxy_header_filename = NewStringf("%s%s_proxy.h", SWIG_output_directory(), Char(module));
|
||||
if ((f_proxy_h = NewFile(proxy_header_filename, "w")) == 0) {
|
||||
if ((f_proxy_h = NewFile(proxy_header_filename, "w", SWIG_output_files())) == 0) {
|
||||
FileErrorDisplay(proxy_header_filename);
|
||||
SWIG_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue