Commit graph

59 commits

Author SHA1 Message Date
William S Fulton
fc4be01106 Refactor multiple inheritance warnings
Slightly simplify choosing single base class when handling
multiple inheritance and make consistent across more languages.
Modula3 multiple inheritance warnings now warn for all bases
2016-02-12 08:45:22 +00:00
Petre Eftime
0a07cd4c30 Prevent redefinition warnings when compiling with SWIG<module> defined
Signed-off-by: Petre Eftime <petre.p.eftime@intel.com>
2015-12-22 14:33:21 +02:00
William S Fulton
faeaacf112 smartptr feature support - factor out common code 2015-09-25 22:57:59 +01:00
Olly Betts
7ba0652677 Create director_common.swg for language-indep code
Move -DSWIG_DIRECTOR_STATIC handling there, so this is now supported for
all languages with director support, not just Python and PHP.
2015-03-12 19:51:11 +13:00
William S Fulton
2e01533b23 Partial support for %constant and structs
Test case is slightly modified from the test case in issue #250

Use of constant objects does not seem to work in Python - the type is
SwigPyObject instead of constant_directive.Type1.
2014-12-18 07:01:08 +00:00
David Nadlinger
a8cdd1798e D: Emit empty enums as int aliases instead of omitting them.
This fixes test-suite/enum_forward.i.
2014-11-06 23:04:35 +01:00
David Nadlinger
0d6472525c D: Fix name collision between im D module function pointer and actual C function.
Previously, the function pointers were not only declared with
extern(C) calling convention, but actually had C linkage
themselves. Thus, they were exported under their bare names,
potentially colliding with the actual function definitions
in the wrapped library if the dynamic linker decided to
resolve them the wrong way.

This fixes the sneaky1 test case, although I have no idea why
the add() reference in D_add() (via the PLT) is rebound to the
function pointer there and not in all other test cases and
real-world libraries. As far as I can see, there don't seem to
be any special symbol visibility/binding settings involved in
our build system.
2014-11-06 23:04:35 +01:00
David Nadlinger
0b42c6f653 D: Fix allprotected_not.i compilation.
The director cycle breaking code was emitted when protectors
were not actually enabled on the parent class, leading to
swigIsMethodOverridden being called but not declared.
2014-11-06 23:04:34 +01:00
Vadim Zeitlin
9f1af8921f Refactor: move makeParameterName() to common Language base class.
This method was duplicated more or less identically for 4 languages and will
be needed for another one soon, so put it in the base class from which it can
be simply reused instead.

No changes in the program behaviour whatsoever.
2014-08-16 13:11:22 +02:00
Olly Betts
36be36d618 Eliminate needless casting away const from string constants 2014-04-30 12:00:23 +12:00
William S Fulton
cd2085aae7 Fixes for C enums used in an API and the definition of the enum has not been parsed.
For D, this fixes a segfault in SWIG.

Java, C#, D, Go now produce code that compiles, although the definition of the
enum is needed in order to use the enum properly from the target language.
2014-03-28 07:54:03 +00:00
Yung Lee
6e06b50adf Remove non-ascii characters at a comment line in d.cxx that trouble VC++ 2013-04-22 18:28:26 +01:00
William S Fulton
e182b4844c Fix seg fault in SWIG using directors when class and virtual method names are the same except being in different namespaces when the %nspace feature is not being used. 2013-03-19 19:50:44 +00:00
William S Fulton
7841a0d097 Remove cvs/svn Id strings 2013-01-12 01:21:16 +00:00
William S Fulton
5889d7bfdd Merge branch 'SFbug1299' of https://github.com/BrantKyser/swig into BrantKyser-SFbug1299 2013-01-11 23:12:06 +00:00
Brant K. Kyser
e1a59ae2c7 Clean up local variable name that store the director class's name to prevent confusion with the class name. 2013-01-08 21:38:57 -06:00
Olly Betts
f9566ad2df Fix assorted typos.
From https://sourceforge.net/p/swig/patches/332/ and some others too.
2013-01-08 18:47:40 +13:00
Brant K. Kyser
b005c68009 Patch for SourceForge Bug #1299 broke D and C#. Update D module to reflect these changes
NOTE: There are several test failures in the D test suite, so it is difficult to be entirely sure this does not break something.
2013-01-05 04:54:02 -06:00
William S Fulton
89052f3b0a Fix Strcmp - it didn't have consistent null pointer handling - revert to what it used to be - a lightweight wrapper around strcmp which means functions once again must not pass in null to it.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13943 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-12-02 13:36:13 +00:00
William S Fulton
d93dc0f8e2 Distinguish between an "abstract" attribute on a class containing a list of abstract members and an "abstract" flag on pure virtual methods - renamed former to "abstracts"
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13935 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-24 14:13:58 +00:00
William S Fulton
0d2c459046 Remove some unused code and pointless variable assignments
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13932 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-23 07:38:00 +00:00
David Nadlinger
1752b62156 [D] Fixed namespace handling bug introduced in r13915.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13920 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-20 20:06:21 +00:00
William S Fulton
0f0172bc0d Fix possible NULL dereference
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13915 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-19 19:48:50 +00:00
William S Fulton
0c7bc36122 Fix obvious copy/paste errors in some director code
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13914 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-19 19:47:48 +00:00
William S Fulton
e0967f3e13 Fix unnecessary and inconsistent null pointer checks
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13912 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-19 19:44:48 +00:00
William S Fulton
d918bddfc0 Fix segfaults when using filename paths greater than 1024 characters in length - use String * and heap instead of fixed size static char array buffers.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13904 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-18 00:45:18 +00:00
William S Fulton
684bd8e472 Minor warning fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13889 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-14 22:48:09 +00:00
William S Fulton
fd24b188e2 Fix Coverity 'Uninitialized pointer fields' - member variables are now initialized
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13887 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-14 22:17:28 +00:00
William S Fulton
46d2486115 Resource leak fixes (or hiding them from Coverity static analysis tool by using String instead of char *)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13886 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-14 22:16:54 +00:00
William S Fulton
5a1e82a2f4 Remove DohClose (Close) and replace with calls to DohDelete (Delete) to fix some minor memory leaks in most uses of NewFile.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13885 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-14 22:16:07 +00:00
William S Fulton
f6229d4b73 Fix director typemap searching so that a typemap specified with a name will be correctly matched. Previously the name was ignored during the typemap search. Implemented by ensuring the 'type' attribute in the Node is set up correctly and using the usual Swig_typemap_lookup on the Node.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13873 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-10-27 17:37:34 +00:00
William S Fulton
cad26e49fe Fix use of deleted memory in D module
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13556 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-08-08 06:06:31 +00:00
William S Fulton
8bf1347354 Warning fixes using clang
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13024 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-04-29 21:51:18 +00:00
David Nadlinger
8fa4d20ec3 [D] Correctly annotate function pointers with C linkage.
Minor cleanups as well.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12899 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-01-23 21:59:00 +00:00
William S Fulton
de5a78c781 Expand symname special variable in director typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12887 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-12-23 16:27:15 +00:00
William S Fulton
468ca084fc Correct special variables in 'directorargout' typemap. This change will break any 'directorargout' typemaps you may have written. Please change: to and to \n Also fix the named 'directorargout' DIRECTOROUT typemaps for these languages which didn't previously compile and add in , etc expansion.\n [C#, Go, Java, D] Add support for the 'directorargout' typemap.\n [Java] Add (char *STRING, size_t LENGTH) director typemaps.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12877 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-12-20 20:50:36 +00:00
William S Fulton
24133bacd7 Remove numerous hard coded 'result' variable name in generated c/c++ wrappers. The variable name is now defined in just one place, making it possible to change the name easily if a target language so wishes - see cwrap.c.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12830 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-10-30 21:51:50 +00:00
William S Fulton
8b9afd0772 Fix %callback which was generating uncompileable code for C# and D
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12785 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-26 18:05:50 +00:00
David Nadlinger
1dcc81fced [D] nspace: Correctly generate identifiers for base classes when
not in split proxy mode.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12641 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-23 13:34:08 +00:00
David Nadlinger
f9def91f30 [D] Ported r12557 (char enum values).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12630 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-10 16:10:42 +00:00
David Nadlinger
6c0f3f1a7d [D] Fixed referencing types in the root namespace when not in split proxy mode.
Previously, invalid code would be generated for cases like the following if the nspace feature was active, but the split proxy mode not:
---
struct Foo {};
namespace Ns {
  struct Bar {
    void bar(const Foo &f) {}
  };
}
---

Thanks to Johannes Pfau for reporting this.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12629 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-10 14:02:52 +00:00
David Nadlinger
3af2e27a3f [D] Fixed qualified name handling, broken since r12588.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12628 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-04-10 14:02:29 +00:00
David Nadlinger
7709e0303a [D] Added -d2 switch to usage information.
Previously, it was documented in the manual, but not present in the command line usage text.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12545 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-16 17:20:45 +00:00
David Nadlinger
ac375e90a8 [D] Whitespace cleanup.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12544 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-16 17:20:21 +00:00
William S Fulton
a63d456f8a Remove redundant code highlighted by warnings in gcc-4.6
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12536 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-14 07:22:08 +00:00
David Nadlinger
ce6516fb4c [D] nspace support.
As for C# and Java, this doesn't work for free functions/variables yet.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12534 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-13 00:32:26 +00:00
David Nadlinger
a63cde3827 [D] Removed "-noproxy" switch from usage text.
I forgot to remove it from the list when I stripped the (undocumented and untested) code paths for it, which was even before the merge to trunk.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12533 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-13 00:31:13 +00:00
David Nadlinger
fb538c1b5b [D] Avoid implicit cast warning when building for x86_64.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12532 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-13 00:30:51 +00:00
William S Fulton
b69b793d8e Better consistency in usage display
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12524 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-09 21:42:38 +00:00
David Nadlinger
85ed05c241 [D] Tiny typo fix.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12405 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-29 21:31:40 +00:00