Commit graph

3,635 commits

Author SHA1 Message Date
William S Fulton
4b4e0180f4 Python initialization code tidy up
I've moved the initialization of statics a little earlier on - a little
safer as it is hard to follow exactly when some of these were being
used, such as SWIG_Py_None which sometimes replaces Py_None.
2018-06-30 19:28:03 +01:00
William S Fulton
b3763c8dc8 Remove SWIG_STATIC_POINTER (Python)
It's use has been removed to discourage thread unsafe static
initialisation.
2018-06-30 17:47:01 +01:00
Petr Mitrichev
40ea0a9606 Add comments that explain the need for globals. 2018-06-28 17:33:31 +02:00
Petr Mitrichev
d956081fd3 Avoid function-local statics that call Python code to avoid deadlocks with GIL 2018-06-28 14:27:52 +02:00
William S Fulton
1665712fcb Python 3.7 support: Remove use of deprecated PyUnicode_GetSize 2018-06-15 19:39:19 +01:00
William S Fulton
e96316bf31 Fix seg fault using Python 2 invalid utf-8 strings and wstring
Fixes seg fault when passing a Python string, containing invalid utf-8 content,
to a wstring or wchar * parameter.  A TypeError is thrown instead, eg:

  %include <std_wstring.i>
  void instring(const std::wstring& s);

  instring(b"h\xe9llooo") # Python
2018-06-15 19:39:12 +01:00
William S Fulton
3915e7bd08 Remove final remnants of GCJ - jstring.i 2018-06-15 06:57:53 +01:00
William S Fulton
4079fb927b Python 3.7 support - deprecation of classes in the collections module
Change the base classes in the pyabc.i file to use the
collections.abc module instead of collections due to the deprecation
of the classes in the collections module in Python 3.7.
2018-06-12 21:05:07 +01:00
William S Fulton
ecf61f8e39 Restore Python 3.2/3.3 support 2018-06-12 08:02:23 +01:00
Olly Betts
7f98830110 [Python] Fix new GCC8 warnings in generated code
Avoid casts between incompatible function types where possible (when
keyword args are in use, it is not possible to avoid such warnings as
they are inherent in the design of Python's C API in that particular
case).  Fixes #1259.
2018-06-11 15:51:53 +12:00
Olly Betts
2ea976f1d8 Always use PyCapsule
It is supported by all the Python versions we now support.
2018-06-08 11:08:31 +12:00
Olly Betts
a82c1b943b Drop support for Python 3.0 to 3.3
See #701.
2018-06-08 11:08:31 +12:00
Olly Betts
1198155083 Drop Python 2.6 support too
See #701.
2018-06-08 11:08:31 +12:00
Olly Betts
7c034ead32 Remove special handling for Python < 2.6
See #701.
2018-06-08 09:34:48 +12:00
Olly Betts
c9d2275a0c Remove lingering trace of support for Python 1.x 2018-06-08 08:47:24 +12:00
William S Fulton
33921666a1 Merge branch 'vadz-doxygen'
This is the Doxygen work begun in Google Summer of Code projects 2008
and 2012 and subsequently improved by numerous contributors.

* vadz-doxygen: (314 commits)
  Add changes entry for Doxygen support
  Add some missing doctype tyemaps
  Doxygen warnings cleanup
  Move doxygen warning numbers
  Add Python doxygen example
  Doxygen example
  Add Doxygen to include paths
  Doxygen source rename
  More merge fixes from doxygen branches
  Correct python example headers
  Correct source code headers
  Another merge fix from doxygen branches
  Java enums output format fixes
  Add omitted doxygen_parsing_enums testcase
  PEP8 conformance for comment verifier module
  Clean up merge problem
  Doxygen html tweaks
  Update html chapter numbering for added Doxygen chapter
  Fixes to makechap.py to detect ill-formed headers
  html fixes for Doxygen
  Add missing CPlusPlus17.html file
  Format files to unix format
  Doxygen testcase tweak to match that in the html docs
  Doxygen html documentation updates and corrections
  Remove doxygen Examples subdirectory
  Beautify doxygen source code
  Code formatting fixes in doxygen code
  Remove unused doxygen code
  new_node refactor
  Various merge fixes in doxygen branches
  Unused variable warning fix
  Fix wrongly resetting indent after formulae in Doxygen comments
  Add support for doxygen:alias feature
  Get rid of meaningless return type of DoxygenParser methods
  Return enum, not untyped int, when classifying Doxygen commands
  Get rid of unnecessary "typedef enum" in C++ code
  Use slash, not backslash, in "C/C++" in the documentation
  Replace literal "<" with "&lt;" in HTML documentation
  Fix broken link to java.sun.com in Doxygen documentation
  Fix using com.sun.tools.javadoc package under macOS
  Fix error reporting for special characters in Doxygen parsing code
  Switch Python Doxygen unit tests to use inspect.getdoc()
  Use correct separator in Java class path under Windows.
  Remove executable permission from appveyor.yml.
  Use JAVA_HOME value in configure to detect Java.
  Display JAVA_HOME value in "make java_version".
  Fix harmless MSVC warning in DoxygenTranslator code.
  Reset "_last" for all but first enum elements.
  Don't duplicate Javadoc from global enum Doxygen comments twice.
  Move Doxygen comments concatenation from the parser to the lexer.
  Fix shift/reduce conflicts in Doxygen pre/post comment parsing.
  Rewrote part of the grammar dealing with Doxygen comments for enums.
  No changes, just remove spurious white space only differences.
  Move Doxygen comment mangling from the parser to the lexer.
  Merge "-builtin" autodoc bugs workarounds from master into test.
  Quote JAVA_HOME variable value in Java test suite makefile.
  Remove unused C_COMMENT_STRING terminal from the grammar.
  Fix missing returns in the Doxygen test suite code.
  Fix trimming whitespace from Doxygen comments.
  Remove code not doing anything from PyDocConverter.
  Remove unused <sstream> header.
  Remove unreferenced struct declaration.
  Remove unused Swig_warn() function.
  Remove any whitespace before ignored Doxygen commands.
  Remove trailing space from one of Doxygen tests.
  Fix autodoc strings generated in Python builtin case and the test.
  Fix Doxygen unit test in Python "-builtin" case.
  Use class docstrings in "-builtin" Python case.
  Don't indent Doxygen doc strings in generated Python code.
  Add a possibility to flexibly ignore custom Doxygen tags.
  Stop completely ignoring many Doxygen comments.
  Fix structural Doxygen comment recognition in the parser.
  No changes, just make checking for Doxygen structural tags more sane.
  Use "//", not "#", for comments in SWIG input.
  Allow upper case letters and digits in Doxygen words.
  Pass the node the Doxygen comment is attached to to DoxygenParser.
  Get rid of findCommand() which duplicaed commandBelongs().
  Recognize unknown Doxygen tags correctly.
  No real changes, just pass original command to commandBelongs().
  Describe Doxygen-specific %features in a single place.
  Give warnings for unknown Doxygen commands in Doxygen parser.
  Document the return type when translating Doxygen @return to Python.
  Fix translated Doxygen comments for overloaded functions in Python.
  Also merge Doxygen comments for overloaded constructors in Python.
  Allow using enum elements as default values for Python functions.
  Don't always use "*args" for all Python wrapper functions.
  No real changes, just make PYTHON::check_kwargs() const.
  Refactor: move makeParameterName() to common Language base class.
  Remove long line wrapping from Python parameter list generation code.
  Simplify and make more efficient building Python docstrings.
  Translate Doxygen code blocks to Sphinx code blocks.
  Add a simple test of multiple parameters to Doxygen test suite.
  Make Python parameters types hyperlinks in the doc strings.
  Make Language::classLookup() and enumLookup() static.
  Fix arguments of @param, @return etc translations to Python.
  Remove unused method from PyDocConverter.
  No real changes, just remove an unnecessary variable.
  Preserve relative indentation when parsing Doxygen comments.
  Use Sphinx-friendly formatting for overloaded functions documentation.
  Add poor man trailing white space detection to Doxygen Python tests.
  ...
2018-06-07 08:13:10 +01:00
Olly Betts
d6d5db122b Remove support for PHP5
PHP5 is no longer actively supported by the PHP developers and security
support for it ends completely at the end of 2018, so it doesn't make
sense to include support for it in the upcoming SWIG 4.0.0 release.

See #701.
2018-06-07 18:09:03 +12:00
William S Fulton
088d7c7773 Add some missing doctype tyemaps 2018-06-05 18:52:30 +01:00
William S Fulton
abfc304740 Various merge fixes in doxygen branches 2018-05-19 08:12:10 +01:00
William S Fulton
0cfd53cff7 Merge branch 'master' into vadz-doxygen
* master:
  Add Octave 4.4 to Travis allow_failures
  Fixes for appveyor image changes
  Javascript test-suite Makefile parallel jobs
  Add changes entry for csconstruct, dconstruct and javaconstruct fix
  Fix lookup of csconstruct, dconstructor and javaconstruct typemaps
  Javascript %nspace fix in generated C++ code
  Add C++17 documentation chapter
  Add changes notes for C++17 nested namespaces support
  Test for invalid C++17 nested namespace aliases
  Test c++17 nested namespaces and %nspace
  Add c++17 nested namespaces runtime test for C#
  Add c++17 nested namespaces runtime test for Python
  Add support for c++17 nested namespaces
  Update CHANGES.current
  .travis.yml: test against Octave 4.4
  Examples/test-suite/register_par.i: rename 'tree' to 'swig_tree'
  Examples/octave/module_load/runme.m: update 'exist()' statements for Octave >= 4.4
  Examples/octave/module_load/runme.m: do not use duplicate function names
  Examples/Makefile.in: unset OCTAVE_PATH when running Octave for tests
  Lib/octave: fix getting/setting global variables for Octave >= 4.4
  Lib/octave: use new class for function member dereference with Octave >= 4.4
  Lib/octave: fix operator installation for Octave >= 4.4
  Lib/Octave: in Octave >= 4.4, assign reference to base class in subclass
  Lib/octave: fix call to mlock() for Octave >= 4.4
  Lib/octave: fix call to octave::call_stack::current() for Octave >= 4.4
  Lib/octave: 'octave_exit' not longer exists in Octave >= 4.4
  Lib/octave: replace is_bool_type() with islogical() for Octave >= 4.4
  Lib/octave: replace is_numeric_type() with isnumeric() for Octave >= 4.4
  Lib/octave: replace is_cell() with iscell() for Octave >= 4.4
  Lib/octave: call octave::feval() instead of feval() for Octave >= 4.4
  Lib/octave: fix function name passed to unwind_protect::begin_frame()
  C#, D, Java methodmodifiers on destructors
  Javascript assert.h - move to header section
  Appveyor cl compiler warning fixes during configure
  Java vector wrappers cast correction
  test-suite fixes (Java directors) for compilers that don't support varargs
  Go - use director.swg like other languages
  test-suite fixes (2) for compilers that don't support varargs
  Consistent spacing in generated exception specifications
  test-suite fixes for compilers that don't support vararg macros
  Enhance Travis testing to use gcc 8 and test C++17 and C17
  Enhance SWIG_isfinite for older standards: C++03/C++98/C89
  test-suite support for gcc-8 targeting C++11 and C++14
  Scilab portability fixes - remove use of strdup
  Scilab array overbounds fix handling char type exceptions
  test-suite fix for c++17 and throw macro
  Remove use of 'register' in C source
  test-suite support for C++17: switch testing of the deprecated C++17 'register' keyword from C++ to C
  Examples update to support C++17: exception specification throw removal
  Cosmetic syntax tweak using throw in Octave directors
  test-suite support for C++17 (Java): exception specification throw removal
  test-suite support for C++17: exception specification throw removal
  __cplusplus macro usage tweak
  Improve detection of Python's 2to3 tool
  Correct C shared library creation when specifing CC to configure
  Remove superfluous parens in generated Python scripts.
  [ci] guile 2.2 build no longer expected to fail
  guile - resstructure some configure tests
  Disable guile configuration if guile-config and guile report a different version
  Fix guile executable detection on early 2.0.x guile versions
  guile - drop GDB_INTERFACE related stuff
  guile - replace obsolete scm_listify with scm_list_n
  guile - use more reliable method of finding guile executable based on guile-config
  Fix go version matching in configure for go1.10
  [Python] Suppress new pycodestyle warning
  Add if-no-present action for jsv8inc arg
  Fix typo in help --with-jscoreinc and --with-jscorelib
  Fix off-by-one error
  * Makefile.in (configfiles): Update URLs for latest configfiles.
  Add changes entry for Ruby %alias fix for global functions
  [Ruby] Pass Qnil instead of NULL to rb_funcall()
  Fix typo
  Fix ruby %alias directive for native c functions
  Stop testing Python on Appveyor msys/mingw
  Fix -Wimplicit-fallthrough gcc-7.3 warning
2018-05-17 19:57:02 +01:00
luz.paz
6f69830321 follow-up typos 2018-05-17 10:26:00 -04:00
luz.paz
60dfa31a67 Misc. typos
found via `codespell` and `grep`
2018-05-17 10:04:23 -04:00
Karl Wette
6586616e23 Lib/octave: fix getting/setting global variables for Octave >= 4.4 2018-05-12 22:25:07 +10:00
Karl Wette
d0b1105f30 Lib/octave: use new class for function member dereference with Octave >= 4.4 2018-05-12 22:25:07 +10:00
Karl Wette
94e8853e61 Lib/octave: fix operator installation for Octave >= 4.4 2018-05-12 22:25:07 +10:00
Karl Wette
84aab22f66 Lib/Octave: in Octave >= 4.4, assign reference to base class in subclass
- See Examples/octave/callback/runme.m: a.run() calls Octave callback,
  but due to changes in behaviour to subsref() a.Callback.run() can no
  longer be used to call C callback unless a.Callback actually exists;
  subsrefs() just gets the "Callback" call whereas prior to Octave 4.4
  it would get both the "Callback" and "run" calls. So now a.Callback is
  set to the original base class (with own=0) so that it can be accessed
2018-05-12 22:25:07 +10:00
Karl Wette
ce67bce72e Lib/octave: fix call to mlock() for Octave >= 4.4 2018-05-12 22:25:07 +10:00
Karl Wette
df92ad6ebc Lib/octave: fix call to octave::call_stack::current() for Octave >= 4.4 2018-05-12 22:25:07 +10:00
Karl Wette
931656bcbe Lib/octave: 'octave_exit' not longer exists in Octave >= 4.4
- Instead must register atexit() function, since Octave still
  cannot clean up its memory usage on exit with SWIG modules
2018-05-12 22:25:07 +10:00
Karl Wette
04357dca21 Lib/octave: replace is_bool_type() with islogical() for Octave >= 4.4 2018-05-12 22:25:07 +10:00
Karl Wette
6f0561eb57 Lib/octave: replace is_numeric_type() with isnumeric() for Octave >= 4.4 2018-05-12 22:25:07 +10:00
Karl Wette
358345db9e Lib/octave: replace is_cell() with iscell() for Octave >= 4.4 2018-05-12 22:25:07 +10:00
Karl Wette
a46909a414 Lib/octave: call octave::feval() instead of feval() for Octave >= 4.4 2018-05-12 22:25:07 +10:00
Karl Wette
e8e507bf0b Lib/octave: fix function name passed to unwind_protect::begin_frame() 2018-05-12 22:25:07 +10:00
William S Fulton
1f7689fa8f Javascript assert.h - move to header section
Fixes compile problem due to throw macro skullduggery in the director_throws testcase
2018-05-06 23:10:33 +01:00
William S Fulton
6551d0fead Java vector wrappers cast correction
64 bit windows, fixes:
  warning C4267: 'initializing': conversion from 'size_t' to 'jint'
2018-05-06 09:46:37 +01:00
William S Fulton
bea708c796 Go - use director.swg like other languages
Changes the location of the director code wrt to the generated _wrap.h
file to fix throw macro skullduggery in the director_throws testcase
(see previous commit).
2018-05-06 09:46:37 +01:00
William S Fulton
3e4b7269c0 Enhance SWIG_isfinite for older standards: C++03/C++98/C89
Fixes testcase overload_numeric with -std=c++98 (clang and gcc 6 and later)

Issue #1239
2018-05-04 20:02:13 +01:00
William S Fulton
35c5a3a42a Scilab portability fixes - remove use of strdup 2018-05-04 20:02:13 +01:00
William S Fulton
179b41067d Scilab array overbounds fix handling char type exceptions 2018-05-04 20:02:13 +01:00
William S Fulton
4e0b2f1402 Cosmetic syntax tweak using throw in Octave directors 2018-05-04 20:02:13 +01:00
William S Fulton
ebd6558a30 __cplusplus macro usage tweak 2018-05-04 20:02:13 +01:00
Geert Janssens
a95ceabb70 guile - drop GDB_INTERFACE related stuff
Guile itself has removed it a long time ago:
http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commit;h=8510e39278161d3cbf8ec4ba87b123fe28763ed4
There's no need for it. I suspect it's just there because the
interface file was created based on the then real main source file of guile.
2018-04-20 08:36:49 +02:00
Geert Janssens
d1f7054b7e guile - replace obsolete scm_listify with scm_list_n
scm_list_n is available in all guile versions supported by swig, while
scm_listify no longer is in guile 2.2
2018-04-20 08:36:48 +02:00
Geert Janssens
46ab0c252d Fix off-by-one error
The condition only applies to guile 1.8 and older so it should really
have been '<2' all along. As we already have such a conditional block
earlier up, merge the two together as well.
2018-04-18 13:07:03 +12:00
Vadim Zeitlin
b7f78dd5a7 Merge branch 'master' into doxygen 2018-03-19 21:54:46 +01:00
William S Fulton
3ce3ce0683 Add std_shared_ptr.i for Scilab and R as boost_shared_ptr.i is already available 2018-03-09 06:58:08 +00:00
William S Fulton
7fbdd21b49 Javascript - Fix compilation error wrapping std::complex via std_complex.i
Closes #1187
2018-02-11 11:12:24 +00:00
Simon Marchetto
1647135369 [scilab] fix compilation (checked with the additional compiler options) 2018-02-01 14:31:52 +01:00
Simon Marchetto
7a9ee39412 [Scilab] fix compilation error 2018-02-01 10:09:35 +01:00