Commit graph

21,690 commits

Author SHA1 Message Date
Karl Wette
d9c94848ec octave.cxx: fix exception raising for newer Octave versions
- Since (at least) Octave 5.1.0, the Octave error() function now raises a C++
  exception, which if uncaught immediately exits a SWIG wrapper function,
  bypassing any cleanup code that may appear after a "fail:" label.
- This patch adds a "try { ... } catch(...) { }" block around the contents of
  SWIG wrapper functions to first execute the cleanup code before rethrowing any
  exception raised.
- It is backward compatible with earlier versions of Octave where error() does
  not raise an exception, which will still branch to the "fail:" block to
  execute cleanup code if an error is encountered.
2020-05-31 06:43:15 +10:00
Karl Wette
e67f125582 octave.cxx: add missing return statement before "fail:" label 2020-05-31 06:43:15 +10:00
Karl Wette
f6286a1b19 octave.cxx: this belongs in the code (as opposed to definition) section 2020-05-31 06:43:15 +10:00
Karl Wette
99bb5dcc70 octave.cxx: remote whitespaces 2020-05-31 06:43:15 +10:00
Karl Wette
66f4f7de8e octave.cxx: replace Printf() with Append() for consistency 2020-05-31 06:43:15 +10:00
Karl Wette
26423d06b3 octruntime.swg: do not use atexit() to quit Octave
- This reverts commit 931656bcbe
- Since atexit() does not pass along the desired exit status,
  __swig_atexit__() always exits with status zero, regardless
  of whether Octave completed successfully or raised an error.
- This means the success/failure of Octave scripts which load
  SWIG modules cannot be determined by other programs, which
  makes them unusable.
- Instead, provide a Octave function swig_exit() which calls
  ::_Exit() with a given exit status. This way at least a
  clean exit from Octave can be guaranteed for future versions
  if the seg-fault problem is not fixed.
2020-05-31 06:43:15 +10:00
Karl Wette
30132bf777 octrun.swg: remove octave_value type-id from octave_swig_bound_func
- The {DECLARE|DEFINE}_OV_TYPEID_FUNCTIONS_AND_DATA declarations
  attached to this class cause a seg-fault in the module_load
  Octave example. Removing these declarations fixes the seg-fault.
- While cause of seg-fault is unknown, note that (in Octave 5.1.0)
  the declaration of octave_function, which is the base class for
  octave_swig_bound_func, does not use these declarations. So it's
  possible they simply are not required for this type of subclass.
2020-05-31 06:43:15 +10:00
Karl Wette
e0d85fc939 configure.ac: fix calls to mkoctfile for Octave configuration
- As of Octave 5.1.0, mkoctfile no longer works with 'env -'
  (no environment), so need to pass at least PATH and
  LD_LIBRARY_PATH for it to work.
- Still need to clear environment so that it doesn't override
  mkoctfile defined variables, e.g. CXXFLAGS.
2020-05-31 06:43:15 +10:00
Marcel Steinbeck
3c9dd44ff4 D: Replace deprecated imports (package std.c). Fixes #1593 2020-05-30 16:28:48 +01:00
William S Fulton
305a824a6e
Merge pull request #1726 from vadz/unsigned-char
Fix reading options files on platforms with unsigned char
2020-05-30 00:01:51 +01:00
William S Fulton
02e967d05d
Merge pull request #1716 from ZackerySpytz/Python-utf8-cache
Use PyUnicode_AsUTF8() for Python >= 3.3
2020-05-29 23:56:10 +01:00
William S Fulton
f5e1e689fc changes file update 2020-05-28 23:53:03 +01:00
William S Fulton
558ed0bb71 Merge branch 'DOH_POOL_SIZE-increase'
* DOH_POOL_SIZE-increase:
  Increase DOH_POOL_SIZE
2020-05-28 23:04:11 +01:00
William S Fulton
f68d0c6da3
Merge pull request #1788 from mcfarljm/Issue-1757
Fix for missing space after \endlink in doxygen
2020-05-28 22:25:53 +01:00
Vadim Zeitlin
8b572399d7 Revert "Use '\\' instead of "\\""
This reverts commit ab8ecbc208 as it broke
AppVeyor CI builds.
2020-05-25 16:06:14 +02:00
Vadim Zeitlin
034a6d54ee Merge branch 'master' of https://github.com/vapier/swig
Use $PKGCONFIG instead of hard-coded pkg-config for JS test.

See https://github.com/swig/swig/pull/1796
2020-05-24 22:08:23 +02:00
Vadim Zeitlin
f422302c7b Merge branches 'guile-c11' and 'python-ci-fix'
Fix Travis CI builds broken due to the changes in Travis CI build
environment since the last successful build.

See #1798, #1799.
2020-05-23 02:35:31 +02:00
Vadim Zeitlin
6cf36d4cd6 Force using C11 for Guile builds on Travis CI
Compiling code including Guile headers with default compiler options
doesn't work any more since a recent (~2020-05-05) update to Guile 3.0.2
on Homebrew (2.2.7 was used previously) due to

error: redefinition of typedef 'scm_print_state' is a C11 feature

in libguile/print.h and scm.h headers.

Work around this by enabling C11 for this build by explicitly setting
CSTD. Note that we can't just use CPP11=1 for this build, because this
would also enable C++11-specific tests that are not currently supported
by Guile module.
2020-05-23 02:33:46 +02:00
Vadim Zeitlin
6c5d00bd0d Ignore ambiguous variable names error from pycodestyle 2.6
This error is given for any use of variable called "l" (and also "I" and
"O", but we don't seem to have any of those) and it doesn't seem to be
worth changing this variable name in the tests code, as it's really not
that meaningful there anyhow, so just disable the warning to let the CI
builds, which now use pycodestyle 2.6, instead of 2.5 which didn't have
this error and which is still the latest available in Debian Sid, pass.
2020-05-22 16:17:45 +02:00
Vadim Zeitlin
ab8ecbc208 Use '\\' instead of "\\"
No real changes, just use simpler quoting construct which is sufficient
(as we don't need to expand any variables) and also happens not to break
Vim 8 syntax highlighting in the entire file, unlike double quotes.
2020-05-22 15:58:21 +02:00
Mike Frysinger
48842cb07b configure: fix pkg-config invocation
The code was already probing $PKGCONFIG but then still falls back
to using the hardcoded `pkg-config` tool.
2020-05-21 19:39:39 -04:00
John McFarland
61dbc4b50c Fix for missing space after \endlink in doxygen
The "endlink" command is processed in processWordCommands, which by
default skips space occuring after the command, which is intended for
removing leading space from a command argument.  For "end" commands,
we don't want to do this.  Note that certain end commands such as
"endcode" aren't processed by processWordCommands (believe
addCommandUnique ends up handling them).

Update usage of \link in doxygen_translate_all_tags.i to test handling
of space after \endlink.

Tweaking some of the usage in doxygen_misc_constructs.i to remove what
seems to be an extra space from the input (otherwise we would need to
add an extra space to the expected output).
2020-05-02 18:42:55 -05:00
Zackery Spytz
3b0db10aa4 Increase DOH_POOL_SIZE
Increase DOH_POOL_SIZE to 2^22.

Addresses GH-1775.
2020-04-18 09:57:20 -06:00
William S Fulton
ae0efd3d74 Merge branch 'nightlark-preprocessor-docs'
* nightlark-preprocessor-docs:
  Correct preprocessor docs
  Preprocessor definitions doc update
  Remove BUILDING_NOTE_EXTENSION from docs
  Add missing preprocessor defines to the docs list
2020-03-05 19:06:08 +00:00
William S Fulton
3f30735478 Correct preprocessor docs
Blatently incorrect information removed.
2020-03-05 19:04:55 +00:00
William S Fulton
9727083c6e Preprocessor definitions doc update
Move language specific definitions into separate section in docs.
2020-03-05 18:56:46 +00:00
William S Fulton
f97b37a316 Minor formatting fixes in Lua.html 2020-03-03 19:23:46 +00:00
Ryan Mast
853987e866 Remove BUILDING_NOTE_EXTENSION from docs 2020-02-28 23:56:57 -08:00
William S Fulton
3a329566f8 Update changes file 2020-02-18 22:14:21 +00:00
William S Fulton
aad43031a4 Merge branch 'ryannevell-master'
* ryannevell-master:
  Clean up test cases
  Fix unwrapping of LUA lightuserdata type. Add test case.
2020-02-18 22:07:05 +00:00
William S Fulton
4ce77ffb77 Ruby - catch exceptions by const reference 2020-02-18 22:06:20 +00:00
William S Fulton
c08e0d19f9 Merge branch 'catch-value'
* catch-value:
  Catch exceptions by reference rather than by value.
2020-02-18 22:00:45 +00:00
Ryan Nevell
18608816db Clean up test cases 2020-02-17 09:16:42 -08:00
Ryan Nevell
33c59614fc Fix unwrapping of LUA lightuserdata type. Add test case. 2020-02-17 09:16:24 -08:00
Vadim Zeitlin
45fdcc2fec Fix reading options files on platforms with unsigned char
This fixes EOF detection on platforms where char is unsigned, as
comparing it with EOF could never return true there.

Thanks gcc for the warning "comparison is always true due to limited
range of data type [-Wtype-limits]".
2020-02-16 17:03:14 +01:00
Daniel Mach
70f6ee9656 Catch exceptions by reference rather than by value.
Fixes -Wcatch-value gcc warnings.
2020-02-14 12:58:49 +01:00
William S Fulton
b465531141 Add conversion operator fix to changes file 2020-02-14 07:39:02 +00:00
William S Fulton
c914b1eb78 Merge branch 'abstract-conversion-operators'
* abstract-conversion-operators:
  Add test cases for abstract user-defined conversion operators
  Recognize C++ conversion operators with trailing '= 0' as abstract
2020-02-14 07:12:26 +00:00
William S Fulton
6cec69ef7b Remove an unnecessary shared_ptr reference count increment in Ruby wrappers
When wrapping STL containers, remove a shared_ptr reference count
increment when an upcast is needed when checking type conversion
in traits_check::check.
2020-02-13 19:48:30 +00:00
William S Fulton
67a38589a8 Minor code refactor in Python traits_asptr::asptr 2020-02-13 19:32:13 +00:00
William S Fulton
e631b226ca Add changes entry for vector<shared_ptr<>> memory leak fix 2020-02-13 19:23:37 +00:00
William S Fulton
fc2f0204ba Port Ruby test of vector<shared_ptr<>> to Python
This test code tests the upcast code:
  swig_assert_equal_simple(-1, base_num2([Derived(7)]))
Although there is no explicit memory leak fix test, it does at least run the code.

Handling of None needs fixing in Python (it is working in Ruby)
Note that the Ruby implementation has a partial template specialization
for shared_ptr, whereas the Python implementation is in the generic
code!

Issue #1512
2020-02-13 19:21:30 +00:00
William S Fulton
339d427910 Merge branch 'master-fix-vector-shared_ptr'
* master-fix-vector-shared_ptr:
  fixing memleak of shared_ptr objects in python with creating a [wrapped] vector<shared_ptr<Foo>> from a list of shared_ptr<Bar> where Bar is derived from Foo.
2020-02-13 19:21:12 +00:00
Thomas REITMAYR
eb2be58a12 Add test cases for abstract user-defined conversion operators 2020-02-13 20:16:44 +01:00
Thomas REITMAYR
059bb0c0a0 Recognize C++ conversion operators with trailing '= 0' as abstract
This fix is done for all supported variants of user-defined conversion
operators and fixes swig#1723.
2020-02-13 20:16:44 +01:00
William S Fulton
e3524be164 html fixes in documentation 2020-02-07 07:27:49 +00:00
William S Fulton
63b3fe8d3b R documentation minor tweaks 2020-02-07 07:18:04 +00:00
William S Fulton
eb7160161d Merge branch 'RDocs2020A'
* RDocs2020A:
  documentation about R accessors, with examples
2020-02-07 07:06:29 +00:00
William S Fulton
012d0f7aa5 Update changes file 2020-02-06 19:09:00 +00:00
William S Fulton
94b4c7dc21 Better error checking when setting 'this' in Python
If python_append.i is modified to use:
__slots__ = []
instead of
__slots__ = ["this"]
then this additional error checking prevents a crash and shows a stack trace and error:
  AttributeError: 'ForSlots' object has no attribute 'this'

Related to issue #1674
2020-02-06 07:27:08 +00:00