Skip to content

Commit

Permalink
Merge pull request #174 from swig-fortran/merge-4.1.0
Browse files Browse the repository at this point in the history
Merge SWIG 4.1.0
  • Loading branch information
sethrj authored Dec 2, 2022
2 parents 77f55ea + 05c11c8 commit 8b5d9c6
Show file tree
Hide file tree
Showing 446 changed files with 9,990 additions and 5,753 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI

on:
push:
branches: master
paths-ignore:
- 'CHANGES*'
- 'Doc/**'
Expand All @@ -13,6 +14,9 @@ on:
- 'Doc/**'
- 'appveyor.yml'

permissions:
contents: read

jobs:
build:

Expand All @@ -30,7 +34,6 @@ jobs:
matrix:
include:
- SWIGLANG: fortran
CPPSTD: c++11
- SWIGLANG: fortran
CPPSTD: c++11
- SWIGLANG: fortran
Expand Down Expand Up @@ -119,7 +122,7 @@ jobs:
ls -la $(which $CC) $(which $CXX)
$CC --version
$CXX --version
$FC --version
if test -n "$FC"; then $FC --version; fi
- name: Configure
run: |
Expand Down Expand Up @@ -176,7 +179,7 @@ jobs:
# Stricter compile flags for examples. Various headers and SWIG generated code prevents full use of -pedantic.
cflags=$($GITHUB_WORKSPACE/Tools/testflags.py --language $SWIGLANG --cflags --std=$CSTD --compiler=$CC)
cxxflags=$($GITHUB_WORKSPACE/Tools/testflags.py --language $SWIGLANG --cxxflags --std=$CPPSTD --compiler=$CC)
fcflags=$($GITHUB_WORKSPACE/Tools/testflags.py --language $SWIGLANG --fcflags --std=$FCSTD --compiler=$FC)
if -n "$FC"; then fcflags=$($GITHUB_WORKSPACE/Tools/testflags.py --language $SWIGLANG --fcflags --std=$FCSTD --compiler=$FC); fi
make check-$SWIGLANG-version
make check-$SWIGLANG-enabled
make $SWIGJOBS check-$SWIGLANG-examples CFLAGS="$cflags" CXXFLAGS="$cxxflags" FCFLAGS="$fcflags"
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Windows Nuget Build

on:
push:
paths-ignore:
- 'CHANGES*'
- 'Doc/**'
- 'appveyor.yml'
pull_request:
branches: master
paths-ignore:
- 'CHANGES*'
- 'Doc/**'
- 'appveyor.yml'

jobs:
build:

runs-on: windows-2019

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

- name: Install Dependencies
shell: powershell
run: |
nuget install CMake-win64 -Version 3.15.5 -OutputDirectory C:\Tools\CMake
nuget install Bison -Version 3.7.4 -OutputDirectory C:\Tools\bison
nuget install PCRE2 -Version 10.39 -OutputDirectory C:\Tools\pcre2
- name: Build
shell: powershell
run: |
$env:PATH="C:\Tools\CMake\CMake-win64.3.15.5\bin;C:\Tools\bison\Bison.3.7.4\bin;" + $env:PATH
$PCRE_ROOT="C:\Tools\pcre2\PCRE2.10.39.0"
$PCRE_PLATFORM="x64"
$WORKING_DIR=(Get-Location).ToString() -replace "\\","/"
cmake -G "Visual Studio 16 2019" -A "x64" `
-DCMAKE_INSTALL_PREFIX="$WORKING_DIR/install2" `
-DCMAKE_C_FLAGS="/DPCRE2_STATIC" `
-DCMAKE_CXX_FLAGS="/DPCRE2_STATIC" `
-DPCRE2_INCLUDE_DIR="$PCRE_ROOT/include" `
-DPCRE2_LIBRARY="$PCRE_ROOT/lib/pcre2-8-static.lib" `
-S . -B build
cmake --build build --config Release
- name: Install
shell: powershell
run: |
cmake --install build --config Release
- name: Test
shell: powershell
working-directory: install2/bin
run: |
swig.exe -version
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ Tools/javascript/Makefile
config.log
config.status
preinst-swig
swig.spec

# Build Artifacts
.dirstamp
Expand Down Expand Up @@ -168,6 +167,14 @@ Examples/java/doxygen/javadocs
Examples/test-suite/javascript/*/
*.gyp

# Lua
Examples/lua/dual/dual
Examples/lua/dual/swigluarun.h
Examples/lua/embed/embed
Examples/lua/embed2/embed2
Examples/lua/embed3/embed3
Examples/lua/embed3/swigluarun.h

# OCaml
Examples/test-suite/ocaml/*.ml*
Examples/test-suite/ocaml/*.cm*
Expand Down
8 changes: 4 additions & 4 deletions ANNOUNCE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*** ANNOUNCE: SWIG 4.1.0 (in progress) ***
*** ANNOUNCE: SWIG 4.1.0 (24 Oct 2022) ***

http://www.swig.org
https://www.swig.org

We're pleased to announce SWIG-4.1.0, the latest SWIG release.

Expand All @@ -19,7 +19,7 @@ and user interface development for large C/C++ systems.
Release Notes
=============
Detailed release notes are available with the release and are also
published on the SWIG web site at http://swig.org/release.html.
published on the SWIG web site at https://swig.org/release.html.

Availability
============
Expand All @@ -32,7 +32,7 @@ A Windows version is also available at
https://prdownloads.sourceforge.net/swig/swigwin-4.1.0.zip

Please report problems with this release to the swig-devel mailing list,
details at http://www.swig.org/mail.html.
details at https://www.swig.org/mail.html.

--- The SWIG Developers

2 changes: 1 addition & 1 deletion CCache/ccache.yo
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ ccache was adapted to create ccache-swig for use with SWIG by William Fulton.

If you wish to report a problem or make a suggestion then please email
the SWIG developers on the swig-devel mailing list, see
url(http://www.swig.org/mail.html)(http://www.swig.org/mail.html)
url(https://www.swig.org/mail.html)(https://www.swig.org/mail.html)

ccache is released under the GNU General Public License version 2 or
later. Please see the file COPYING for license details.
Expand Down
59 changes: 31 additions & 28 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Version 4.0.2 (8 Jun 2020)
[D] #1593 Replace broken imports when using newer versions of D.

2020-05-29: ZackerySpytz
[Python] #1716 Performance improvements converting strings when using Python >= 3.3.
[Python] #1716 Performance improvements when converting strings when using Python >= 3.3.

2020-05-28: ZackerySpytz
#1776 Quite dramatically decrease run times when generating very large interface files by changing
Expand Down Expand Up @@ -74,8 +74,8 @@ Version 4.0.2 (8 Jun 2020)
[Ruby] #1651 Add std::auto_ptr<> typemaps.

2020-01-31: ZackerySpytz
[Python] #1700 More robust error checking for failures in calls to Python C API:
PyBytes_AsStringAndSize() and PyString_AsStringAndSize().
[Python] #1700 The Python C API functions PyBytes_AsStringAndSize() and
PyString_AsStringAndSize() are now checked for failure.

2020-01-31: vadz
[Python] #1710 Fix crash parsing empty docstrings.
Expand Down Expand Up @@ -115,7 +115,7 @@ Version 4.0.2 (8 Jun 2020)

2020-01-13: wsfulton
[Python] #1595 Python -builtin constructors silently ignored keyword arguments.
Instead of silenty ignoring them, now a "TypeError: f() takes no keyword arguments"
Instead of silently ignoring them, now a "TypeError: f() takes no keyword arguments"
exception is thrown if keyword arguments are used. Hence constructors and normal methods/
functions behave in the same way. Note, -keyword should be used with -builtin to obtain
keyword argument support.
Expand Down Expand Up @@ -200,7 +200,7 @@ Version 4.0.1 (21 Aug 2019)
VectorOverload(std::vector< Number,std::allocator< Number > >)
VectorOverload(std::vector< int,std::allocator< int > >)

The problem was due to some error handling that was not cleared during typehecking.
The problem was due to some error handling that was not cleared during typechecking.
In this case an error was not cleared when the elements in the list failed the
typecheck for converting to X. Only occurs in Python 3+.

Expand Down Expand Up @@ -289,6 +289,7 @@ Version 4.0.1 (21 Aug 2019)
2019-05-22: ferdynator
[PHP] #1528 Don't add a closing '?>' PHP tag to generated files.
PSR-2 says it MUST be omitted for files containing only PHP.

Version 4.0.0 (27 Apr 2019)
===========================

Expand Down Expand Up @@ -3137,7 +3138,7 @@ Version 3.0.3 (30 Dec 2014)

2014-09-12: olly
[PHP] Add support for specifying any PHP interfaces a wrapped class
implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator";
implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator"

2014-09-11: olly
[PHP] Fix throwing a PHP exception through C++ from a subclassed
Expand Down Expand Up @@ -3302,7 +3303,7 @@ Version 3.0.0 (16 Mar 2014)
project has been further extended. The C++11 support is comprehensive, but by no means complete
or without limitations. Full details for each new feature in C++11 is covered in the
CPlusPlus11.html chapter in the documentation which is included in SWIG and also available
online at http://www.swig.org/Doc3.0/CPlusPlus11.html.
online at https://www.swig.org/Doc3.0/CPlusPlus11.html.

2014-03-14: v-for-vandal
[Lua] Numerous Lua improvements:
Expand Down Expand Up @@ -5784,7 +5785,7 @@ Version 2.0.0 (2 June 2010)

2010-02-27: wsfulton
License code changes: SWIG Source is GPL-v3 and library code license is now clearer
and is provided under a very permissive license. See http://www.swig.org/legal.html.
and is provided under a very permissive license. See https://www.swig.org/legal.html.

2010-02-13: wsfulton
[Ruby] A few fixes for compiling under ruby-1.9.x including patch from 'Nibble'.
Expand Down Expand Up @@ -8396,8 +8397,8 @@ Version 1.3.30 (November 13, 2006)
javabase/csbase typemap, eg in the following, 'Me' will be the base class,
no matter what Foo is really derived from in the C++ layer.

%typemap(javabase, replace="1") Foo "Me";
%typemap(csbase, replace="1") Foo "Me";
%typemap(javabase, replace="1") Foo "Me"
%typemap(csbase, replace="1") Foo "Me"

Previously it was not possible for the javabase/csbase typemaps to override the C++ base.

Expand Down Expand Up @@ -9884,7 +9885,7 @@ Version 1.3.28 (February 12, 2006)
solutions is to write:

%typemap(in) A * {...}
%typemap(freeag) A * "";
%typemap(freeag) A * ""

overload 'freearg' with an empty definition.

Expand Down Expand Up @@ -11314,20 +11315,20 @@ Version 1.3.27 (October 15, 2005)
then the typemap will be inserted without the block
imposed by the brackets, similar to

%typemap(in) Hello "...";
%typemap(in) Hello "..."

So, why you don't just use the quote style?, because:

1.- The quote style doesn't get preprocessed, for example

%typemap(in) Hello "$1= SWIG_macro($1);";
%typemap(in) Hello "$1= SWIG_macro($1);"

here, SWIG_macro doesn't get expanded

2.- Inside a quote typemap, you have to use
quotes carefully

%typemap(in) Hello "$1 = \"hello\" ";
%typemap(in) Hello "$1 = \"hello\" "

3.- You can't make emacs and/or other editors
to indent inside a string!.
Expand Down Expand Up @@ -11529,7 +11530,7 @@ Version 1.3.26 (October 9, 2005)

%define hello(name, Type)
%define name ## a(Type)
%typemap(in) Type "hello;";
%typemap(in) Type "hello;"
%enddef
%enddef

Expand Down Expand Up @@ -13525,7 +13526,7 @@ Version 1.3.23 (November 11, 2004)
whereupon the default of 0 was used. You can get the same behaviour for C
code by using the "default" typemap:

%typemap(default) int val "$1 = 0;";
%typemap(default) int val "$1 = 0;"
%{
void foo(int val);
%}
Expand Down Expand Up @@ -13854,9 +13855,11 @@ Version 1.3.22 (September 4, 2004)
specifiers from the C type. This makes it possible, for instance, to control
whether a C "char" argument takes a Lisp character or a Lisp integer value.
The default (taking Lisp characters) is done by these built-in typemaps:
%typemap(ffitype) char ":char"; %typemap(lisptype) char "character";
%typemap(ffitype) char ":char"
%typemap(lisptype) char "character"
If char means an integer instead, use these typemaps:
%typemap(ffitype) char ":char"; %typemap(lisptype) char "integer";
%typemap(ffitype) char ":char"
%typemap(lisptype) char "integer"

08/22/2004: wsfulton
As discussed in bug #772453, the SWIG library directory is now installed
Expand Down Expand Up @@ -18874,9 +18877,9 @@ Version 1.3.14 (August 12, 2002)
shadowinterface

Note that it is possible to target a particular proxy class:
%typemap(javaimports) Foo "import java.util.*";
%typemap(javaimports) Foo "import java.util.*"
or a particular type wrapper class:
%typemap(javaimports) double* "import java.math.*";
%typemap(javaimports) double* "import java.math.*"
Note that $javaclassname in these typemaps are substituted with either the proxy
classname when using proxy classes or the SWIGTYPE class name.

Expand Down Expand Up @@ -19614,8 +19617,8 @@ Version 1.3.12 (June 2, 2002)
typemap must exactly match up with the "in" or "ignore"
typemap. For example:

%typemap(in) (char *data, int len) { ... };
%typemap(freearg) char *data { ... };
%typemap(in) (char *data, int len) { ... }
%typemap(freearg) char *data { ... }

void foo(char *data, int len);

Expand Down Expand Up @@ -21071,15 +21074,15 @@ Version 1.3.11 (January 31, 2002)

Second, a typemap can force a no-match by defining

%typemap(in) sometype "pass";
%typemap(in) sometype "pass"

If this is used, the typemap system will *not* record a
typemap match for "sometype". This can be used to block
selected typemaps. For example, if you wanted to disable
a typemap feature for some type, you could do this.

// Do not allow global variables of type 'const char *' to be set.
%typemap(varin) const char * "pass";
%typemap(varin) const char * "pass"

It might also be possible to use this to do subtle and
strange things with typemaps. For example, if you wanted to
Expand All @@ -21093,8 +21096,8 @@ Version 1.3.11 (January 31, 2002)
... return a value ...
}
/* Block unqualified typemaps defined above */
%typemap(ignore) const blah * "pass";
%typemap(argout) const blah * "pass";
%typemap(ignore) const blah * "pass"
%typemap(argout) const blah * "pass"
%typemap(in) const blah * {
... get input value ...
}
Expand Down Expand Up @@ -21871,7 +21874,7 @@ Version 1.3.10 (December 10, 2001)
%typemap directive can now accept nearly arbitrary keyword parameters.
For example:

%typemap(in,parse="i",doc="integer") int "...";
%typemap(in,parse="i",doc="integer") int "..."

The purpose of the keyword parameters is to supply code generation
hints to the target language module. The intepretation of the
Expand Down Expand Up @@ -23949,7 +23952,7 @@ Version 1.3 Alpha 4 (September 4, 2000)
Typemaps can now be specified using string literals like
this:

%typemap(in) int "$target = SvIV($source);";
%typemap(in) int "$target = SvIV($source);"

When code is specified like this, it is *NOT* enclosed
inside a local scope (as with older typemap declarations).
Expand Down
Loading

0 comments on commit 8b5d9c6

Please sign in to comment.