summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [guile] Stop using deprecated aliasesguile-changesOlly Betts2022-03-165-12/+15
| | | | | | | The replacements should all work with Guile 1.8.0, which is the oldest version we still aim to support. Fixes #1624
* [guile] Document that Guile 2.2.x and 3.0.x workOlly Betts2022-03-161-2/+2
|
* [ci] Only test guile on this branchOlly Betts2022-03-161-279/+0
|
* [ci] Add testing for guile 2.2 and 3.0Olly Betts2022-03-162-1/+5
|
* [Go] add typemaps for std::string*Ian Lance Taylor2022-03-153-9/+53
| | | | Fixes #2214
* [Go] Don't convert arrays to pointers if there is a "gotype" typemap entry.Ian Lance Taylor2022-03-154-2/+50
| | | | Fixes #749
* [Go] Add documentation note about Go and C++ exceptions.Ian Lance Taylor2022-03-153-13/+29
| | | | | For #418 Fixes #518
* [Go] Add notes about recent Go-related changes.Ian Lance Taylor2022-03-151-0/+11
|
* Add some code comments about Python objects and capsule reference countingWilliam S Fulton2022-03-151-0/+3
| | | | Issue #2208
* Re-enable overloading test for php8William S Fulton2022-03-151-5/+0
|
* [ci] Adjust how CPPFLAGS is setOlly Betts2022-03-151-2/+2
| | | | | | Set it so it should be visible where the CI log shows the environment, as `make` is run with `-s` so the compile command lines are unhelpfully not shown.
* Adjust Python variables example for Python 2Olly Betts2022-03-151-1/+1
| | | | | Explicitly call str() as previously Python 2 seemed to end up calling repr().
* [scilab] Fix to work on WindowsYungLee2022-03-153-13/+15
| | | | | | | | | * Change the builder filename to match the loader filename * Mark extern functions with SWIGEXPORT * Fix bug: builder.sce not generated if with '-scilab -builder' option Fixes #1853
* Re-enable symbol poisoning in a CI jobOlly Betts2022-03-152-6/+4
| | | | | | | | | It seems too brittle to enable by default as we'd have to avoid including any system headers after doh.h, which is hard to enforce, but just having it enabled for one CI job should avoid uses of the poisoned symbols from being accidentally introduced. See #2223
* List variables in variables exampleOlly Betts2022-03-151-1/+3
| | | | | Seems useful in itself, but also serves to check if https://sourceforge.net/p/swig/bugs/976/ is still reproducible.
* Fix SWIG_Py*Method_New conditionalOlly Betts2022-03-141-2/+18
| | | | | | | This should be a SWIG-time conditional, but was inside %{ %} so was instead a compile-time conditional. Fix for bug in the changes in #2191
* %interface family of macros no longer add variable wrappersWilliam S Fulton2022-03-127-2/+48
| | | | | | | | | The getter/setter methods used for wrapping methods are no longer added to the interface class. Closes #1524 Also add in testcase for enums.
* %interface family of macros enum fix for JavaWilliam S Fulton2022-03-121-4/+1
| | | | | enums were being generated into the interface class instead of the proxy class.
* Use GetFlag instead of Getattr for feature:interfaceWilliam S Fulton2022-03-124-17/+17
|
* Fixes for the family of %interface macros for overloaded methodsWilliam S Fulton2022-03-1212-15/+259
| | | | | | | | | | | | | | | | | When C++ methods are not able to be overloaded in a derived class, such as when they differ by just const, or the target language parameters types are identical even when the C++ parameter types are different, SWIG will ignore one of the overloaded methods with a warning. A %ignore is required to explicitly ignore one of the overloaded methods to avoid the warning message. Methods added in the derived classes due to one of the %interface macros are now similarly ignored/not added to the derived class. The adding of additional methods into the parse tree is now more robust and complete resulting in support for %feature and %rename for the added methods. Closes #1277
* Disable use of gcc poison pragmasWilliam S Fulton2022-03-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Needs a rethink to avoid use of poisoned macros in system headers. I see this on Ubuntu 16.04: gcc -DHAVE_CONFIG_H -I../Source/Include -I../Source/CParse -I../Source/Include -I../Source/DOH -I../Source/CParse -I../Source/Doxygen -I../Source/Preprocessor -I../Source/Swig -I../Source/Modules -g -O2 -Wall -W -pedantic -MT DOH/base.o -MD -MP -MF $depbase.Tpo -c -o DOH/base.o DOH/base.c &&\ mv -f $depbase.Tpo $depbase.Po In file included from /usr/include/string.h:630:0, from DOH/dohint.h:21, from DOH/base.c:15: /usr/include/x86_64-linux-gnu/bits/string2.h:1282:19: error: attempt to use poisoned "calloc" ? (char *) calloc ((size_t) 1, (size_t) 1) \ ^ /usr/include/x86_64-linux-gnu/bits/string2.h:1284:32: error: attempt to use poisoned "malloc" char *__retval = (char *) malloc (__len); \ ^ /usr/include/x86_64-linux-gnu/bits/string2.h:1302:19: error: attempt to use poisoned "calloc" ? (char *) calloc ((size_t) 1, (size_t) 1) \ ^ /usr/include/x86_64-linux-gnu/bits/string2.h:1308:26: error: attempt to use poisoned "malloc" __retval = (char *) malloc (__len); \ ^
* HTML fixesWilliam S Fulton2022-03-122-2/+7
|
* Using declarations, directors and overloaded methodsWilliam S Fulton2022-03-104-13/+168
| | | | | | | | | Language::unrollVirtualMethods was assuming that the using declaration would only introduce one method. Fix this by adding in all the overloaded methods from a base class. Affects code generation in C# and Java, but I was not able to construct a test that failed before this commit.
* Refactor code out of Language::unrollVirtualMethodsWilliam S Fulton2022-03-102-70/+81
| | | | | | Move code in main loop into new function to handle one method at a time. In preparation for next commit for using declaration fix. Remove unused default_director variable.
* Language::unrollVirtualMethods variable initialisation refactorWilliam S Fulton2022-03-101-8/+4
|
* Add missing symtab for functions added by using declarationsWilliam S Fulton2022-03-102-1/+4
| | | | | | | Fixes fully qualified names for functions added by using declarations: - Error messages show fully qualified names in Lua - Overload warning messages show fully qualified names - Error messages calling dispatch functions for handling overloaded methods in OCaml, Python and Tcl
* Fix segfault in C# layer handling using declarationsWilliam S Fulton2022-03-103-2/+35
| | | | | | | | | | | Segfault was actually avoided in previous commit ab23cb29. This commit makes handling more robust in the event of using %ignore just on the derived method, not tested as it is not what one should do with directors, and possibly other cases. Go still segfaults with the new testcase director_using_member_scopes.i. Issue #1441.
* Using declarations in derived class parameters scoping fixWilliam S Fulton2022-03-104-22/+74
| | | | | | | | | Fix using declaration in derived class incorrectly introducing a method from a base class when the using declaration is declared before the method declaration. Problem occurred when within a namespace and the parameter types in the method signatures were not fully qualified. Issue #1441
* Remove confusing extra parameter from doc exampleOlly Betts2022-03-093-3/+3
| | | | | | | | The initial prototype shown in these examples has a `len` parameter but that the rest of the example is as if that parameter isn't there so remove it from the initial prototype. Fixes https://sourceforge.net/p/swig/bugs/1289/
* swig -go: treat a nil argument as NULLIan Lance Taylor2022-03-084-12/+53
| | | | | | | Let Go code pass "nil" when calling a C++ function that accepts a pointer to a class. The Go "nil" will be treated as a C++ "nullptr". Fixes #2203
* Go docs: add note on thread local storageIan Lance Taylor2022-03-082-17/+33
| | | | Fixes #374
* Handle `)` in command line interface filenameOlly Betts2022-03-083-7/+36
| | | | | | | | | SWIG now handles an interface filename specified on the command line which contains a closing parenthesis `)`, and more generally with attributes to `%include` and `%import` which are quoted and contain parentheses. Fixes #1006
* [Tcl] Fix SWIG_AsWCharPtrAndSize() to assign resultOlly Betts2022-03-082-0/+10
| | | | | | | | | | | | Fix SWIG_AsWCharPtrAndSize() to actually assign to result variable. It looks like SWIG/Tcl wide character handling is currently fundamentally broken except on systems which use wide characters as the system encoding, but this should fix wrapping functions which take a wide string as a parameter on Microsoft Windows. Patch from Omar Medina. Fixes https://sourceforge.net/p/swig/bugs/1290/
* swig -go: free correct variable in char *& typemapIan Lance Taylor2022-03-061-1/+1
|
* Clarify name used for matching out typemapsOlly Betts2022-03-071-3/+5
| | | | | Based on a patch from Dustin J. Mitchell in https://sourceforge.net/p/swig/bugs/915/
* [Python] Fix memory leak.Olly Betts2022-03-072-2/+22
| | | | | | | | | | | | | SWIG python objects were being freed after the corresponding SWIG module information was destroyed in Python 3, causing leaks when as a result the object destructor could not be invoked. To prevent this misordering, SWIG python objects now obtain a reference to the Python capsule wrapping the module information, so that the module information is correctly destroyed after all SWIG python objects have been freed (and corresponding destructors invoked). Fixes #2154 Fixes #2208
* Fix PCRE2 macro used in AppVeyor testing.Andrew Rogers2022-03-071-1/+1
|
* Fix fatal error implemented by assertOlly Betts2022-03-072-9/+13
| | | | | | | Calling assert() on a condition that's always false is not an appropriate way to exit after emitting "Fatal error [...]" because if NDEBUG is defined the assert() becomes a no-op and the error stops actually being fatal.
* Add/update docs for Malloc(), Exit(), etcOlly Betts2022-03-072-6/+26
| | | | See #2223
* [Javascript] Fix handling of functions which take void*Olly Betts2022-03-075-2/+36
| | | | Fixes #682
* Fix rename_camel testcase to work for GoOlly Betts2022-03-072-25/+21
|
* Stop suggesting %name in Guile.htmlOlly Betts2022-03-071-3/+5
| | | | %name has been deprecated since 2004.
* Reenable rename_camel testcaseOlly Betts2022-03-071-1/+1
| | | | It was on the "broken" list, but it should now work.
* Fix and expand rename_camel.i testcaseOlly Betts2022-03-073-12/+64
| | | | | | | | | | | | | | | | The regex pattern to upper-case things containing an `i` had incorrect escaping (`\\(`...`\\)` instead of `(`...`)`) so `import` didn't get renamed. This wasn't detected because there were no `_runme` files for this testcase, so add rename_camel_runme.php which uses reflection to check the wrapped PHP classes, functions and constants are all named as expected. Also expand coverage of converting to underscore case and add coverage for converting to lower-camel-case. Related to #1041.
* Remove redundant conditionalOlly Betts2022-03-071-4/+0
| | | | | | | clang defines __GNUC__ and __GNUC_MINOR__ as if it were GCC 4.2.1 and has since clang 2.4, which was before __has_builtin() was added. Closes #1239
* add doc on %attribute and templates (#2224)Kris Thielemans2022-03-071-1/+22
| | | Document behaviour found in #2142
* swig -go: treat non-const references as pointersIan Lance Taylor2022-03-054-19/+115
| | | | | | | Also clean up the handling of int* and int& to convert between the C type int and the Go type int, which are often different sizes. Fixes #2210
* swig -go: fail test if "go build" failsIan Lance Taylor2022-03-051-0/+16
|
* Try to prevent direct use of exit(), malloc(), etcOlly Betts2022-03-064-16/+50
| | | | | | Use `#pragma GCC poison` (supported since GCC 3, maybe earlier) when compiling with GCC to help prevent direct uses being introduced for functions which DOH provides a wrapper for.
* Eliminate C++11 from constant_expr testOlly Betts2022-03-061-3/+10
| | | | | | | This was introduced by a recent commit adding a testcase matching an example in the manual. There doesn't seem to be a suitable termplate in the standard library before C++11, so instead use a dummy version of std::array defined in the testcase.