Revert rev 11187 "Merged with recent changes from trunk."

This reverts commit c595e4d90ebfd63eb55430c735bb121cf690bd59.

Conflicts:

	Source/Modules/c.cxx

From: William S Fulton <wsf@fultondesigns.co.uk>

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@13033 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-05-06 01:13:16 +00:00
commit d6b81eb831
703 changed files with 9266 additions and 21128 deletions

View file

@ -74,7 +74,7 @@ static void copy_location(const DOH *s1, DOH *s2) {
Setline(s2, Getline((DOH *) s1));
}
static String *cpp_include(const_String_or_char_ptr fn, int sysfile) {
static String *cpp_include(String_or_char *fn, int sysfile) {
String *s = sysfile ? Swig_include_sys(fn) : Swig_include(fn);
if (s && single_include) {
String *file = Getfile(s);
@ -85,8 +85,7 @@ static String *cpp_include(const_String_or_char_ptr fn, int sysfile) {
Setattr(included_files, file, file);
}
if (!s) {
/* XXX(bhy) may not need the seek */
/* Seek(fn, 0, SEEK_SET); */
Seek(fn, 0, SEEK_SET);
if (ignore_missing) {
Swig_warning(WARN_PP_MISSING_FILE, Getfile(fn), Getline(fn), "Unable to find '%s'\n", fn);
} else {
@ -262,9 +261,8 @@ void Preprocessor_error_as_warning(int a) {
* ----------------------------------------------------------------------------- */
String *Macro_vararg_name(const_String_or_char_ptr str, const_String_or_char_ptr line) {
String *argname;
String *varargname;
String_or_char *Macro_vararg_name(String_or_char *str, String_or_char *line) {
String_or_char *argname, *varargname;
char *s, *dots;
argname = Copy(str);
@ -290,24 +288,24 @@ String *Macro_vararg_name(const_String_or_char_ptr str, const_String_or_char_ptr
return varargname;
}
Hash *Preprocessor_define(const_String_or_char_ptr _str, int swigmacro) {
Hash *Preprocessor_define(const String_or_char *_str, int swigmacro) {
String *macroname = 0, *argstr = 0, *macrovalue = 0, *file = 0, *s = 0;
Hash *macro = 0, *symbols = 0, *m1;
List *arglist = 0;
int c, line;
int varargs = 0;
String *str;
String_or_char *str = (String_or_char *) _str;
assert(cpp);
assert(_str);
assert(str);
/* First make sure that string is actually a string */
if (DohCheck(_str)) {
s = Copy(_str);
copy_location(_str, s);
if (DohCheck(str)) {
s = Copy(str);
copy_location(str, s);
str = s;
} else {
str = NewString((char *) _str);
str = NewString((char *) str);
}
Seek(str, 0, SEEK_SET);
line = Getline(str);
@ -534,7 +532,7 @@ macro_error:
*
* Undefines a macro.
* ----------------------------------------------------------------------------- */
void Preprocessor_undef(const_String_or_char_ptr str) {
void Preprocessor_undef(const String_or_char *str) {
Hash *symbols;
assert(cpp);
symbols = Getattr(cpp, kpp_symbols);
@ -652,7 +650,14 @@ static String *get_filename(String *str, int *sysfile) {
if (isspace(c))
Ungetc(c, str);
}
Swig_filename_correct(fn);
#if defined(_WIN32) || defined(MACSWIG)
/* accept Unix path separator on non-Unix systems */
Replaceall(fn, "/", SWIG_FILE_DELIMITER);
#endif
#if defined(__CYGWIN__)
/* accept Windows path separator in addition to Unix path separator */
Replaceall(fn, "\\", SWIG_FILE_DELIMITER);
#endif
Seek(fn, 0, SEEK_SET);
return fn;
}