Commit graph

98 commits

Author SHA1 Message Date
Olly Betts
631b41ae7b Use https for swig.org links 2022-10-06 13:16:39 +13:00
William S Fulton
a87e722834 Use GetFlag instead of Getattr for feature:interface 2022-03-12 23:04:24 +00:00
Seth R Johnson
5a2656ab80 Don't mark as "noassign" when a variable is immutable
I had assumed member variables could only be noassign by being "const",
but I had forgotten about the `%immutable` keyword being applied via
SWIG.
2022-02-04 14:03:01 -05:00
Seth R Johnson
03dd2ec39d Auto-detect non-assignable classes
Classes with references or const data are now marked as 'noassign'.
This renders many explicit `private: operator=` declarations redundant.
2022-02-04 09:51:18 -05:00
luz.paz
60dfa31a67 Misc. typos
found via `codespell` and `grep`
2018-05-17 10:04:23 -04:00
Vladimir Kalinin
91f29c09ae #733 - wrong "override" calculation in import mode 2016-06-27 20:27:10 +03:00
William S Fulton
a1245ef398 Re-organization of the interface feature common code
Move code to new feature.cxx file.
Activate it in the allocate phase rather than in individual languages.
2016-03-03 08:55:20 +00:00
William S Fulton
3718b810c7 Don't generate constructor wrappers if a base class has a private constructor
g++-5 errors out with this now with errors such as:

default_constructor_wrap.cxx:665:27: error: use of deleted function ‘FFF::FFF()’
   result = (FFF *)new FFF();
                           ^
default_constructor_wrap.cxx:314:7: note: ‘FFF::FFF()’ is implicitly deleted because the default definition would be ill-formed:
 class FFF : public F {
       ^
default_constructor_wrap.cxx:301:4: error: ‘F::~F()’ is private
    ~F() { }
    ^
default_constructor_wrap.cxx:314:7: error: within this context
2015-07-07 20:15:55 +01:00
Olly Betts
36be36d618 Eliminate needless casting away const from string constants 2014-04-30 12:00:23 +12:00
William S Fulton
dbf44fc181 Fix std::map and smart pointers.
Fixes problem with method overloading when some methods are added by %extend
and others are real methods and using template default parameters with smart pointers.
This is noticeable as a regression since 2.0.12 when using the default smart pointer
handling for some languages when the smart pointer wraps std::map and other STL containers.

Fixes SF Bug 1363
2014-03-06 19:52:03 +00:00
Vladimir Kalinin
b4fef06c42 fixed %template within %extend, test added
fixed language symbol table nested classes name separator, test added
fixed %feature "flatnested" working with %extend
fixed Swig_offset_string for empty string
added simple template to save/restore values in current scope (readability reasons)
2013-12-19 02:11:22 +04:00
William S Fulton
44a883a057 Cosmetics/code beautification of nested class support 2013-11-29 07:29:58 +00:00
Vladimir Kalinin
b63c4839fe Nested classes support
Closes #89
Squash merge branch 'master' of https://github.com/wkalinin/swig into wkalinin-nested

By Vladimir Kalinin
* 'master' of https://github.com/wkalinin/swig:
  CPlusPlusOut mode for Octave
  nested class illustration
  fixed "Abstract" flag for nested classes added an example enabled anonymous nested structs runtime test
  porting
  warnings disabled
  porting fixes
  java runtime tests ported
  nested class closing bracket offset fixed
  removed double nested template (not supported by %template parsing)
  template_nested test extended
  parent field made public
  property access fixed
  replaced tabs with spaces
  warning W-reorder
  deprecated warnings removed, derived_nested runtime test added
  optimized string indenting
  Nested classes indenting
  nested classes docs
  fixed the order in which flattened inner classes are added after the outer
  Private nested classes were getting into the type table.
  Java getProxyName() fix for nested classes fixes the case when nested classes is forward declared
  Fix for a case when a nested class inherits from the same base as the outer. (Base class constructor declaration is found first in this case)
  merge fix
  nested C struct first immediate declaration incorrectly renamed sample fixed
  tests updated to reflect nested classes support
  Java nested classes support (1)
  flattening should remove the link to the outer class
  access mode correctly set/restored for nested classes
  nested templates should be skipped while flattening (template nodes themselves, not expanded versions) also non-public nested classes should be ignored
  If nested classes are not supported, default behaviour is flattening, not ignoring flag "nested" is preserved, so, the nested classes can be ignored by user
  nested workaround test updated
  template instantiated within a class is marked as nested for ignoring purposes
  %ignore not applied to the nested classed, because "nested" flag is set too late
  typedef name takes precedence over the real name (reason?)
  unnamed structs should be processed for all the languages
  nested C struct instances are wrapped as "immutable"
  tree building
  typedef declaration for unnamed C structures fixed
  nested classes "flattening"
  fixed %ignoring nested classes
  renamed "nested" attribute to "nested:outer" added "nested" flag, to be used with $ignore (it is not removed while flattening) added nestedClassesSupported() function to the Language interface
  renamed "nested" attribute to "nested:outer" added "nested" flag, to be used with $ignore (it is not removed while flattening) added nestedClassesSupported() function to the Language interface
  tree iteration fix
  dirclassname variable names unified memory issue fixed
  merge error
  ignore unnamed structs for C++
  unnamed nested C structs naming & unnesting
  class added to classes hash under typedef name
  private nested classes skipped
  test updated due to nested templates support
  anonymous structs with inheritance fixed nested_class test to allow anonymous structs w/o declarator
  tests updated: nested workaround removed from namespace_class.i propagated nested template declaration to the C++ file
  injected members scope
  nested tempplates fixes, nested structures in "C" mode parsing added utility function "appendSibling" (like "appendChild")
  nested unnamed structures parsing fixes, access mode restored on nested class end, tdname is properly patched with outer class name prefix
  memory management fixes
  nested templates (1)
  Nested unnamed structs
  Nested class support (1)
  Nested class support (1)
2013-11-29 07:02:34 +00:00
William S Fulton
e566c5fa7f Add support for parsing C++11 =delete and =default
Although this was documented as working, it wasn't implemented
%typemap(default) failed without the idstring changes
Add some C tests using the C++ keyword delete
2013-11-20 19:12:16 +00:00
William S Fulton
b725625e6f Add support for thread_local when specified with other legitimate storage class specifiers - extern and static 2013-02-08 06:36:39 +00:00
William S Fulton
7841a0d097 Remove cvs/svn Id strings 2013-01-12 01:21:16 +00:00
William S Fulton
9b40eb58e3 cosmetic variable name changes for abstracts to match previous commit
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13936 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-24 14:15:20 +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
709d683926 Minor code optimisation
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13934 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-11-24 14:12:57 +00:00
William S Fulton
4c6f66577a Add warnings for badly named destructors. Fix %extend and destructors for templates - they weren't always being wrapped. Fix destructor "name" attribute.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12804 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-09-13 06:15:29 +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
William S Fulton
fb6f48dda4 Apply patch #3171793 from szager - protected director methods failing when -fvirtual is used.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12458 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-13 16:33:12 +00:00
William S Fulton
3219746776 Apply patch #3066958 from Mikael Johansson to fix default smart pointer handling when the smart pointer contains both a const and non-const operator->.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12240 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-10-03 13:12:00 +00:00
William S Fulton
cb64f65bae SWIG license change - Source moves to GPLv3
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11876 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-02-27 23:53:33 +00:00
William S Fulton
83bd820285 Add typemaps used debugging option (-debug-tmused). Fix missing file/line numbers for typemap warnings and in the output from the -debug-tmsearch/-debug-tmused options
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11802 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-01-04 19:33:52 +00:00
William S Fulton
4516c1d3f3 Fix exception handling when %catches is used in C#
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11583 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2009-08-15 23:22:20 +00:00
William S Fulton
03ac417e7f simpler error display for method names using new Swig_name_decl()
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10281 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2008-02-28 23:14:07 +00:00
William S Fulton
fe042d2ebc Replace cvs $Header$ with svn $Id$
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10003 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2007-10-17 21:42:11 +00:00
William S Fulton
a75b902902 add missing new line to warning
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9527 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-11-06 22:45:31 +00:00
William S Fulton
aa04c4c057 beautify/format source code with gnu indent
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9505 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-11-01 23:54:54 +00:00
William S Fulton
fa40d8f98b Fix #1508327 - Overloaded methods are hidden when using -fvirtual optimisation
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9375 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-09-28 21:52:20 +00:00
Olly Betts
1e19f11fdc Use Strchr/strchr instead of Strstr/strstr when searching for a single
character.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9334 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-09-23 22:36:23 +00:00
William S Fulton
a9d5f49c4a fix compiler warnings
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9181 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-06-29 22:03:56 +00:00
William S Fulton
da8b2acc99 Fixes for override / hidden methods detection when using directors (for C#)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9143 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-06-02 22:08:09 +00:00
William S Fulton
7f74b8e7a3 Common template for head of each file detailing licence, distribution and authors information
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8972 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-03-06 22:51:01 +00:00
Marcelo Matus
8b9a7ae769 solve duplicate symbol issue reported by Andreas Held
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8744 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-02-08 02:06:15 +00:00
Marcelo Matus
dba7b6d425 fix detection of public access
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8526 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-23 17:31:15 +00:00
Marcelo Matus
290a7da24c fix extend constructor + default destructor
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8433 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-14 21:23:09 +00:00
Marcelo Matus
a24b11a8d3 clarify in the code what is the catch list and the throw list, which don't have to be the same, and don't modify the throws attribute since it should be inmutable (for xml and others)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8368 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-11 01:34:06 +00:00
Marcelo Matus
a925249e0b change the %catchs name to %catches
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8357 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-10 23:17:15 +00:00
Marcelo Matus
e676d2f8bd rename %throws to %catchs
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8351 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-10 18:47:51 +00:00
Marcelo Matus
b044703d0d better support for the %throws directive
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8350 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2006-01-10 17:19:22 +00:00
Marcelo Matus
381596b0f3 add the copyctor feature/directive to enable automatic copy constructors. In the way, fix how default ctor/dtor are added
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8129 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-30 00:04:00 +00:00
Marcelo Matus
d812f5fe5e disable copyctor
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8036 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-22 08:38:02 +00:00
Marcelo Matus
723281a823 generate implicit copyctor, add -nocopyctor, and clarify the -nodefault, -nodefaultctor, -nodefautldtor options
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8030 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-12-22 06:26:26 +00:00
Marcelo Matus
645f95d633 fix many/many memory leaks
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7904 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-11-30 21:32:27 +00:00
Marcelo Matus
b6a927c84c fix bug #1292926
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7698 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-20 15:42:48 +00:00
William S Fulton
b3584316e7 Modify following features to work as flags, so that they can be truely set and unset: notabstract
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7582 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-10-04 20:20:41 +00:00
William S Fulton
4e3bc83ad5 Modify following features to work as flags, so that they can be truely set and unset:
exceptionclass


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7571 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-30 23:21:59 +00:00
William S Fulton
1fd078512c Modify following features to work as flags, so that they can be truely set and unset:
nodefault


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7568 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-30 23:05:50 +00:00