summaryrefslogtreecommitdiff
path: root/Lib/mzscheme
Commit message (Collapse)AuthorAgeFilesLines
* Allow using snprintf() instead of sprintf() in wrappersOlly Betts2023-04-271-5/+6
| | | | | | | | | | | | | | | | | | | We aim to produce code that works with C90 or C++98 so we can't assume snprintf() is available, but it almost always is (even on systems from before it was standardised) so having a way to use it is helpful. Enable this automatically if the compiler claims conformance with at least C90 or C++98 and check SWIG_HAVE_SNPRINTF to allow turning on manually, but disable if SWIG_NO_SNPRINTF if defined. The fallback is to call sprintf() without a buffer size check - checking after the call is really shutting the stable door after the horse has bolted, and most of our uses either have a fixed maximum possible size or dynamically allocate a buffer that's large enough. Fixes: #2502 (sprintf deprecation warnings on macos) Fixes: #2548
* Cleanup SWIG_VERSION definitionWilliam S Fulton2022-10-131-2/+0
| | | | | | | | | | | | | Add Swig_obligatory_macros which must be called by each target language to define SWIG_VERSION correctly in the generated code, as well as the language specific macro SWIGXXX where XXX is the target language name. Drop the #ifdef SWIGXXX that was previously generated - I can't see the point of this and if users are defining this macro somehow, then users will need to change this Closes #1050
* Sort out predefined SWIG-specific macrosOlly Betts2022-10-051-0/+2
| | | | | | | | | | | | | | | | | | | Ensure that SWIG_VERSION is defined both at SWIG-time and in the generated C/C++ wrapper code (it was only defined in the wrapper for some target languages previously). SWIGGO and SWIGJAVASCRIPT are now defined in the generated wrappers to match behaviour for all other target languages. Stop defining SWIGVERSION in the wrapper. This only happened as a side-effect of how SWIG_VERSION was defined but was never documented and is redundant. The new testcase also checks that SWIG is defined at SWIG-time but not in the generated wrapper, and that exactly one of a list of target-language specific macros is defined. Fixes #1050
* std::string throws typemapsWilliam S Fulton2022-09-191-0/+7
| | | | | | | Go, Guile, Racket, Scilab: Add throws typemaps for std::string so that thrown string exception messages can be seen. Test all language for std::string throws typemaps
* Add Racket throws typemaps for char *William S Fulton2022-09-191-0/+4
|
* Add missing typecheck typemaps for std::auto_ptr and std::unique_ptrWilliam S Fulton2022-09-172-0/+12
| | | | To fix overloading when using these types.
* Provide SWIGTYPE MOVE typemaps in swigmove.iWilliam S Fulton2022-09-161-0/+19
| | | | | | | | | | | | For implementing full move semantics when passing parameters by value. Based on SWIGTYPE && and std::unique_ptr typemaps which implement move semantics. Added for all languages, but untested for: Go, Ocaml, R, Scilab (and unlikely to be fully functional for same reasons as for std::unique_ptr support). Issue #999
* Racket - NULL pointer handlingWilliam S Fulton2022-08-311-9/+13
| | | | | | | | | SWIG now converts a C/C++ NULL pointer into a null value by calling scheme_make_null(), so that scheme's null? is true for a NULL C/C++ pointer value. Consistency with Guile and needed for a pending commit for handling NULL and std::unique_ptr.
* SWIGTYPE && input typemaps now assume object has been movedWilliam S Fulton2022-08-313-9/+17
| | | | | | | | | | | | | | | | | | | | Replicated Java implementation. Fully implemented for: - C# - D - Guile - Javascript (UTL) - Lua - MzScheme - Octave (UTL) - Perl (UTL) - PHP - Python (UTL) - Ruby (UTL) - Tcl (UTL) PHP std::auto_ptr std::unique_ptr minor tweaks and testcase corrections
* Cosmetic stray semi-colon removal after %typemap using quotesWilliam S Fulton2022-08-311-5/+5
|
* Add Racket support for std::unique_ptr and std::auto_ptrWilliam S Fulton2022-08-184-7/+100
| | | | | | | Equivalent to Guile implementation. Slight tweak to proxy ownership was required by adding in the own member to swig_mz_proxy.
* More move semantics improvementsWilliam S Fulton2022-07-041-1/+1
| | | | | More removal of casts in the out typemaps when copying objects to enable C++ compilers to possibly make use of move semantics.
* Movable and move-only types supported in "out" typemaps.William S Fulton2022-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enhance SWIGTYPE "out" typemaps to use std::move when copying objects, thereby making use of move semantics when wrapping a function returning by value if the returned type supports move semantics. Wrapping functions that return move only types 'by value' now work out the box without having to provide custom typemaps. The implementation removed all casts in the "out" typemaps to allow the compiler to appropriately choose calling a move constructor, where possible, otherwise a copy constructor. The implementation alsoand required modifying SwigValueWrapper to change a cast operator from: SwigValueWrapper::operator T&() const; to #if __cplusplus >=201103L SwigValueWrapper::operator T&&() const; #else SwigValueWrapper::operator T&() const; #endif This is not backwards compatible for C++11 and later when using the valuewrapper feature if a cast is explicitly being made in user supplied "out" typemaps. Suggested change in custom "out" typemaps for C++11 and later code: 1. Try remove the cast altogether to let the compiler use an appropriate implicit cast. 2. Change the cast, for example, from static_cast<X &> to static_cast<X &&>, using the __cplusplus macro if all versions of C++ need to be supported. Issue #999 Closes #1044 More about the commit: Added some missing "varout" typemaps for Ocaml which was falling back to use "out" typemaps as they were missing. Ruby std::set fix for SwigValueWrapper C++11 changes.
* Avoid -Wempty-body warnings from SWIG_contract_assertOlly Betts2022-02-111-6/+8
|
* Consistent parameter names for std::pairWilliam S Fulton2019-02-141-8/+8
|
* Add STL container copy constructors where missingWilliam S Fulton2019-02-142-6/+8
| | | | Also provide consistent copy constructor declarations.
* Add missing typedefs to std::vector + typedef correctionsWilliam S Fulton2019-02-131-0/+16
| | | | | | | Tests for std::vector of pointers added which check std::vector<T*>::const_reference and std::vector<T*>::reference usage which gave compilation errors in Python and Perl which had specialized these vectors incorrectly.
* Add missing typedefs to std::pairWilliam S Fulton2019-02-131-0/+4
|
* Add missing typedefs to std::mapWilliam S Fulton2019-02-131-0/+36
|
* Add missing parameter names in STL container wrappersWilliam S Fulton2019-02-132-6/+6
| | | | | | | Mostly in STL copy constructors. Best to have parameter names as they make their way into the wrappers in some target languages.
* Create a consistent stl.i library fileWilliam S Fulton2019-02-121-2/+1
| | | | | Same file now for all languages except R which is still missing std_map.i. Recent Java changes adding in std_set.i removed.
* Fix overloading for non-pointers and NULL - MzSchemeWilliam S Fulton2018-12-303-3/+13
|
* Add support for non-default compare template argument in std::map wrappersWilliam S Fulton2018-10-091-96/+96
|
* Add some missing SWIGINTERN usageWilliam S Fulton2017-01-171-2/+5
|
* Whitespace cleanup of all Makefiles*Karl Wette2014-05-021-1/+0
| | | | | - some of the %.clean rules in the test-suite Makefiles were using a single tab as an empty rule, dangerous! I've replaced these with the safer '@exit 0'.
* Merge branch 'master' into gsoc2009-matevzWilliam S Fulton2013-10-102-2/+2
|\ | | | | | | | | | | | | | | | | | | Conflicts: Examples/Makefile.in Examples/guile/Makefile.in Lib/php/php.swg Makefile.in Source/CParse/parser.y configure.ac
| * Drop guilegh interfaceGeert Janssens2013-04-281-1/+1
| | | | | | | | | | | | | | | | All of guile's interface files now use the scm interface. This should not affect any users. Swig generated code using the scm interface can be mixed with gh interface using user code. It does simplify maintenance of the guile swig code though.
| * Minor extraneous makefiles tidy upWilliam S Fulton2013-04-191-1/+1
| |
* | Merge branch 'master' into gsoc2009-matevzWilliam S Fulton2013-01-283-10/+5
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parser.y still to be fixed up Conflicts: Doc/Devel/engineering.html Examples/Makefile.in Lib/allegrocl/allegrocl.swg Lib/csharp/csharp.swg Lib/csharp/enums.swg Lib/csharp/enumsimple.swg Lib/csharp/enumtypesafe.swg Lib/java/java.swg Lib/python/pydocs.swg Lib/r/rtype.swg Source/Include/swigwarn.h Source/Modules/octave.cxx Source/Modules/python.cxx Source/Modules/ruby.cxx Source/Swig/scanner.c Source/Swig/stype.c Source/Swig/swig.h configure.ac
| * Move contributors to COPYRIGHT file.William S Fulton2012-09-071-9/+0
| | | | | | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13734 626c5289-ae23-0410-ae9c-e8d60b6d4f22
| * std::string typemap modifications so they can be used with %apply for other ↵William S Fulton2012-05-261-1/+1
| | | | | | | | | | | | string classes git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13120 626c5289-ae23-0410-ae9c-e8d60b6d4f22
| * Fix some language's std::map wrappers to recognise difference_type, ↵William S Fulton2012-05-151-0/+4
| | | | | | | | | | | | size_type, key_type and mapped_type. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13092 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* | Add rvalue reference typemapsWilliam S Fulton2013-01-241-3/+12
|/
* Apply Ubuntu patch to fix Mzscheme std::map wrappersWilliam S Fulton2010-04-091-8/+8
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11986 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Change typemap matching rules for the default type (SWIGTYPE) to follow ↵William S Fulton2010-04-011-0/+7
| | | | | | template partial specialization type deduction. Fixes some containers of const pointers. SWIGTYPE*& typemps removed and replaced with SWIGTYPE *const&. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11958 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* SWIG license change - The Examples and Lib move to a very permissive license ↵William S Fulton2010-02-279-27/+0
| | | | | | in the LICENSE file, removing the BSD license restrictions as agreed by committers since it was inadvertently introduced. Remove some examples where the impact of the license change is not clear. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11874 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Add newmemory parameter for SWIG_TypeCastWilliam S Fulton2008-02-101-1/+4
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10240 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* When wrapping C++ code, generate code which usesOlly Betts2007-09-171-2/+2
| | | | | | | | | std::string::assign(PTR, LEN) rather than assigning std::string(PTR, LEN). Using assign generates more efficient code (tested with GCC 4.1.2). git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9936 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* * Bug fix in the dynamic loading code of the mzscheme bindingHans Oesterholt-Dijkema2006-09-171-1/+2
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9293 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Fixes for std::pair typemapsLuigi Ballabio2006-08-011-23/+23
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9230 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* * mzscheme code can now dynamically load libraries, that are neededHans Oesterholt-Dijkema2006-07-091-0/+194
| | | | | | | | | | | | | | | | | | at runtime. This allows for code to be generated at some site, and distributed without the need for SWIG. The distribution needs only the header filesfor which the code has been generated. Linking is done at runtime, by loading the dynamic libraries. Functions are resolved when needed. Though somewhat inefficient, it provides for a way to distribute code or binaries that are independent of the version of the installed libraries, which comes in especially handy for e.g. binding against Gtk. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9211 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Common template for head of each file detailing licence, distribution and ↵William S Fulton2006-03-079-46/+69
| | | | | | authors information git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8973 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* [MzScheme] Typemaps for all integral types now accept the full rangeMatthias Köppe2006-02-193-20/+86
| | | | | | | | | | | of integral values, and they signal an error when a value outside the valid range is passed. [Guile] Typemaps for all integral types now signal an error when a value outside the valid range is passed. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8844 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* std::string global and member variables are wrapped as strings by defaultWilliam S Fulton2006-01-291-0/+2
| | | | | | | | | No need to use the %apply const std::string& { std::string* } trick anymore Please test if possible, I can't run these languages. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8618 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Each target language now has its own std_deque.i like the other STL wrappers.William S Fulton2006-01-081-0/+1
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8303 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* add initial stl.i to ensure proper file inclussion and extensions for each ↵Marcelo Matus2006-01-061-0/+7
| | | | | | language git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8232 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* Use the system angle brackets for %includeWilliam S Fulton2005-11-263-4/+4
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7871 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* use exception specification instead of %exception to handle STL error checkingWilliam S Fulton2005-07-273-62/+18
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7352 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* contract support - patch from Hans Oesterholt-DijkemaWilliam S Fulton2005-06-161-0/+8
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7292 626c5289-ae23-0410-ae9c-e8d60b6d4f22
* added missing constructors for std::pairWilliam S Fulton2005-05-251-0/+24
| | | | git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7221 626c5289-ae23-0410-ae9c-e8d60b6d4f22