Commit graph

34 commits

Author SHA1 Message Date
William S Fulton
1ba48ceb99 Initialise all newly created arrays in arrays.i library.
Affects C++ code only.

Closes #440.
2015-07-30 20:41:15 +01:00
William S Fulton
ef75735e9b pedantic warning fix for D wrappers 2015-02-11 23:24:39 +00:00
William S Fulton
b45c3737c8 Add c++11 strongly typed enum support for D 2014-11-28 08:13:27 +00:00
David Nadlinger
278308cfd3 D: Fix exception handling support.
The original code was ported from the C# module. It looks like it
tried to avoid reading TLS data by using a shared counter. However,
without also synchronizing on the counter check (or using atomics)
the code is racy. While the races might be benign (the thread that
sets the exception also increments the counter, so when there is
actually an exception, the visible value will always be non-zero
even if it is outdated), they are still undefined behavior,
strictly speaking. Additionally, just using TLS isn't expensive
either.
2014-11-06 23:04:36 +01:00
David Nadlinger
95e8db7c62 D: Fix class/method name ambiguity in test-suite/c_delete.i.
There might be other cases where this happens when $dclassname
is used for code emitted into the proxy class itself, but so
far, there are none in the test suite or any bug reports.
2014-11-06 23:04:35 +01:00
Timothee Cour
2b2260e996 _ 2014-08-12 09:11:10 -07:00
Curtis Dunham
fe91d6449f Remove register storage class declarations
They're unnecessary, anacronistic, deprecated in modern
standards, generally ignored, useless, and (most importantly)
clang complains about them.
2014-02-19 11:58:27 -06:00
Marvin Greenberg
843aa7cd65 Work around differences in clang libc++ std::vector<bool>::const_reference
clang++ using -stdlib=libc++ defines const_reference as a class,
to map boolean vectors onto a bit set.  Because swig does
not "see" the type as "const &" it generates incorrect code for this case,
generating a declaration like:

  const_reference result;

When const_reference is a typedef to 'bool' as is the case with stdlibc++
this works.  When this is actually a constant reference, this is clearly
invalid since it is not initialized.  For libc++, this is a class
which cannot be default constructed, resulting in an error.  The fix
is to explicitly define the various accessor extensions as having a
bool return type for this specialization.
2014-02-04 16:00:12 -05:00
William S Fulton
cc650e692e Director exceptions now derive from std::exception 2014-01-20 19:40:52 +00:00
William S Fulton
1a19451c1b Error out attempting to use directors without -c++
Remove redundant #ifdef __cplusplus markers in director.swg
2013-12-23 20:23:54 +00:00
William S Fulton
135a7cc558 Beautify director.swg files
Also some comment corrections for Perl
2013-12-23 19:50:41 +00:00
William S Fulton
12a9671440 std::string typemap modifications so they can be used with %apply for other string classes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13120 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-26 06:33:49 +00:00
David Nadlinger
7615b099d1 [D] Reverted part of #3502431 mistakenly applied in r12948.
(The changes only concerned D2, and were already present in trunk.)

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13000 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-04-17 12:17:42 +00:00
William S Fulton
cd770b27ff Apply #3502431 to fix duplicate symbols in multiple modules and compiler errors due to lack of const in some methods taking char*.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12948 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-03-24 01:01:06 +00:00
David Nadlinger
17a7ba0403 [D] Exception and Error have become blessed names; removed d_exception_name test case.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12900 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-01-23 21:59:20 +00:00
David Nadlinger
8fa4d20ec3 [D] Correctly annotate function pointers with C linkage.
Minor cleanups as well.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12899 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-01-23 21:59:00 +00:00
William S Fulton
4c898b023c The 'directorin' typemap now accepts , etc expansions instead of having to use workarounds - _name, _name etc.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12879 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-12-21 07:16:44 +00:00
David Nadlinger
e2b2f26bf6 [D] Use stdc.config.c_long/c_ulong to represent C long types.
Previously, C's long/ulong types would always be mapped to 32 bit integers in D, which is wrong on D_LP64, but was not really a problem in practice since DMD used to be 32 bit only.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12861 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-12-03 19:48:01 +00:00
David Nadlinger
730e14077d [D] Fix exception glue code for newer DMD 2 versions.
Thanks to Andrej Mitrovic for reporting.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12856 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-12-03 19:46:46 +00:00
William S Fulton
30206f975c Fix constructors in named typedef class declarations
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12784 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-25 19:27:38 +00:00
William S Fulton
8ee0593036 Remove incomplete directorin typemaps as users incorrectly assumed they were implemented and working
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12653 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-03 05:46:00 +00:00
William S Fulton
837835280d Remove directorout INPUT/INOUT/OUTPUT typemaps - they will never be used as they used for the return type, not parameters. Fix java directorin typemap.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12651 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-05-03 05:32:13 +00:00
David Nadlinger
ce6516fb4c [D] nspace support.
As for C# and Java, this doesn't work for free functions/variables yet.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12534 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-03-13 00:32:26 +00:00
David Nadlinger
828fac25cb [D] Don't break function return types in typemaps.i.
This fixes the new "li_typemaps_apply" testcase as done for C# in r12400.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12409 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-29 21:32:36 +00:00
David Nadlinger
de53ede681 [D] Fix byte/ubyte confusion in typemaps.i.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12408 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-29 21:32:23 +00:00
David Nadlinger
160ee9c937 [D] Support for C++ references to primitive types.
I am not sure why these typemaps were missing before since I included code for this in the C++ part of the feature, but please let me know if I missed some case where this could break generated code.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12406 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-01-29 21:31:53 +00:00
David Nadlinger
ab2af5ebe2 [D] Removed leftover %dstripprefix definition.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12359 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-12-30 17:37:48 +00:00
David Nadlinger
38c88a0931 [D] Operator overloading support for D1 and D2.
As mentioned in the documentation, opIndexAssign and implicit casting are not supported yet.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12357 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-12-30 02:44:04 +00:00
David Nadlinger
3477a9dff1 [D] Replaced the term "wrap D module" with "intermediary D module" (including names derived from it).
This was suggested by wsfulton on the mailing list in order to bring the D module in line with the C# one, the naming scheme of which is intended to be language-independent.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12319 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-11-28 23:12:03 +00:00
David Nadlinger
a22df2eca9 [D] Refer to the built-in Exception class using its fully-qualified name.
A C++ class called "Exception" could shadow the built-in one before, leading to compilation errors in the exception handling code.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12318 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-11-27 00:13:44 +00:00
David Nadlinger
e362f85431 [D] Use __cdecl instead of __stdcall on Windows as well to avoid special casing.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12303 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-11-22 00:33:26 +00:00
David Nadlinger
cd492d8300 [D] Added a missing part of the Windows wrapper library loading code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12302 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-11-21 23:43:19 +00:00
David Nadlinger
d69d8ff641 [D] Renamed the "dnativeconst" feature to "dmanifestconst".
This should make it clearer that it controls manifest constant generation, not handling of C++ const member functions.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12300 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-11-18 10:16:05 +00:00
David Nadlinger
03aefbc6e9 Added support for the D programming languge.
It is still a bit rough around some edges, particularly with regard to multi-threading and operator overloading, and there are some documentation bits missing, but it should be fine for basic use.

The test-suite should build and run fine with the current versions of DMD, LDC and Tango (at least) on Linux x86_64 and Mac OS X 10.6.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12299 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-11-18 00:24:02 +00:00