summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2023-05-04 13:17:01 +1200
committerOlly Betts <olly@survex.com>2023-05-04 13:18:10 +1200
commit695dd9ddf15ceafeec601a17d05de6105163c919 (patch)
tree7833e7602fc1057c7c4ef064a0892056e6593b84
parent63b1293e1a760e0ce1a27208a5231e705c8f0f3b (diff)
downloadswig-695dd9ddf15ceafeec601a17d05de6105163c919.tar.gz
[D] Update docs for D1 removal
-rw-r--r--CHANGES.current6
-rw-r--r--Doc/Manual/D.html12
-rw-r--r--Examples/test-suite/d/README3
-rw-r--r--Examples/test-suite/operator_overload.i4
-rw-r--r--Lib/d/dhead.swg2
-rw-r--r--Lib/d/dkw.swg2
-rw-r--r--RELEASENOTES1
7 files changed, 17 insertions, 13 deletions
diff --git a/CHANGES.current b/CHANGES.current
index 472fad78a..23cb2e33b 100644
--- a/CHANGES.current
+++ b/CHANGES.current
@@ -7,6 +7,12 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
Version 4.2.0 (in progress)
===========================
+2023-05-04: erezgeva
+ [D] #2538 Drop support for D1/Tango, which was discontinued in
+ 2012. Wrappers for D2/Phobos are now generated by default, though
+ the -d2 command line option is still accepted (and now ignored) for
+ backward compatibility.
+
2023-04-27: olly
#2502 Allow using snprintf() instead of sprintf() in wrappers.
diff --git a/Doc/Manual/D.html b/Doc/Manual/D.html
index 4b4e3c2c0..d61a06391 100644
--- a/Doc/Manual/D.html
+++ b/Doc/Manual/D.html
@@ -48,7 +48,7 @@
<p>Well, besides the obvious downside that the C header files have to be manually converted to D modules for this to work, there is one major inconvenience with this approach: D code usually is on a higher abstraction level than C, and many of the features that make D interesting are simply not available when dealing with C libraries, requiring you e.g. to manually convert strings between pointers to <tt>\0</tt>-terminated char arrays and D char arrays, making the algorithms from the D2 standard library unusable with C arrays and data structures, and so on.</p>
-<p>While these issues can be worked around relatively easy by hand-coding a thin wrapper layer around the C library in question, there is another issue where writing wrapper code per hand is not feasible: C++ libraries. D did not support interfacing to C++ in version 1 at all, and even if <tt>extern(C++)</tt> has been added to D2, the support is still very limited, and a custom wrapper layer is still required in many cases. </p>
+<p>While these issues can be worked around relatively easy by hand-coding a thin wrapper layer around the C library in question, there is another issue where writing wrapper code per hand is not feasible: C++ libraries. Support for C++ was added in D2 via <tt>extern(C++)</tt> but this support is still very limited, and a custom wrapper layer is still required in many cases. </p>
<p>To help addressing these issues, the SWIG C# module has been forked to support D. Is has evolved quite a lot since then, but there are still many similarities, so if you do not find what you are looking for on this page, it might be worth having a look at the chapter on <a href="CSharp.html#CSharp">C#</a> (and also on <a href="Java.html#Java">Java</a>, since the C# module was in turn forked from it).</p>
@@ -61,7 +61,7 @@
<dl>
<dt><tt>-d2</tt></dt>
<dd>
- <p>By default, SWIG generates code for D1/Tango. Use the <tt>-d2</tt> flag to target D2/Phobos instead.</p>
+ <p>Prior to SWIG 4.2.0, SWIG generated wrappers for D1/Tango by default and <tt>-d2</tt> could be used to generate D2/Phobos wrappers instead. SWIG 4.2.0 dropped support for D1, and D2 wrappers are now produced by default. This option is still recognised to allow existing build systems calling SWIG to work, but is not a no-op.</p>
</dd>
<dt><a name="D_splitproxy"></a><tt>-splitproxy</tt></dt>
@@ -314,7 +314,7 @@ $importtype(AnotherInterface)
<dl>
<dt><tt>%dmanifestconst</tt> and <tt>%dconstvalue(value)</tt></dt>
<dd>
- <p>Out of the box, SWIG generates accessor methods for C <tt>#defines</tt> and C++ constants. The <tt>%dmanifestconst</tt> directive enables wrapping these constants as D manifest constants (<tt>const</tt> in D1, <tt>enum</tt> in D2).</p>
+ <p>Out of the box, SWIG generates accessor methods for C <tt>#defines</tt> and C++ constants. The <tt>%dmanifestconst</tt> directive enables wrapping these constants as D manifest constants (<tt>enum</tt> in D2).</p>
<p>For this to work, the C/C++ code for the constant value must directly compile as D code, though. If this is not the case, you can manually override the expression written to the D proxy module using the <tt>%dconstvalue</tt> directive, passing the new value as parameter.</p>
<p>For <tt>enum</tt>s, again <tt>%dconstvalue</tt> can be used to override the value of an enum item if the initializer should not compile in D.</p>
</dd>
@@ -417,11 +417,11 @@ struct A {
<H3><a name="D_operator_overloading">24.8.3 Operator overloading</a></H3>
-<p>The D module comes with basic operator overloading support for both D1 and D2. There are, however, a few limitations arising from conceptual differences between C++ and D:</p>
+<p>The D module comes with basic operator overloading support. There are, however, a few limitations arising from conceptual differences between C++ and D:</p>
<p>The first key difference is that C++ supports free functions as operators (along with argument-dependent lookup), while D requires operators to be member functions of the class they are operating on. SWIG can only automatically generate wrapping code for member function operators; if you want to use operators defined as free functions in D, you need to handle them manually.</p>
-<p>Another set of differences between C++ and D concerns individual operators. For example, there are quite a few operators which are overloadable in C++, but not in D, for example <tt>&amp;&amp;</tt> and <tt>||</tt>, but also <tt>!</tt>, and prefix increment/decrement operators in <a href="https://www.digitalmars.com/d/1.0/operatoroverloading.html">D1</a> resp. their postfix pendants in <a href="https://www.digitalmars.com/d/2.0/operatoroverloading.html">D2</a>.</p>
+<p>Another set of differences between C++ and D concerns individual operators. For example, there are quite a few operators which are overloadable in C++, but not in D, for example <tt>&amp;&amp;</tt> and <tt>||</tt>, but also <tt>!</tt>, and postfix increment/decrement operators (see the <a href="https://www.digitalmars.com/d/2.0/operatoroverloading.html">D documentation</a> for details).</p>
<p>There are also some cases where the operators can be translated to D, but the differences in the implementation details are big enough that a rather involved scheme would be required for automatic wrapping them, which has not been implemented yet. This affects, for example, the array subscript operator, <tt>[]</tt>, in combination with assignments - while <tt>operator []</tt> in C++ simply returns a reference which is then written to, D resorts to a separate <tt>opIndexAssign</tt> method -, or implicit casting (which was introduced in D2 via <tt>alias this</tt>). Despite the lack of automatic support, manually handling these cases should be perfectly possible.</p>
@@ -429,7 +429,7 @@ struct A {
<H3><a name="D_test_suite">24.8.4 Running the test-suite</a></H3>
-<p>As with any other language, the SWIG test-suite can be built for D using the <tt>*-d-test-suite</tt> targets of the top-level Makefile. By default, D1 is targeted, to build it with D2, use the optional <tt>D_VERSION</tt> variable, e.g. <tt>make check-d-test-suite D_VERSION=2</tt>.</p>
+<p>As with any other language, the SWIG test-suite can be built for D using the <tt>*-d-test-suite</tt> targets of the top-level Makefile.</p>
<p>Note: If you want to use GDC on Linux or another platform which requires you to link <tt>libdl</tt> for dynamically loading the shared library, you might have to add <tt>-ldl</tt> manually to the <tt>d_compile</tt> target in <tt>Examples/Makefile</tt>, because GDC does not currently honor the <tt>pragma(lib, ...)</tt> statement.</p>
diff --git a/Examples/test-suite/d/README b/Examples/test-suite/d/README
index bb5372882..2e7aa6e2d 100644
--- a/Examples/test-suite/d/README
+++ b/Examples/test-suite/d/README
@@ -2,6 +2,3 @@ D language module testsuite
---------------------------
Please see ../README for the common readme file.
-
-By default the D1 version is built, set D_VERSION=2 (in the environment or at
-the make command line) to run it for D2 instead.
diff --git a/Examples/test-suite/operator_overload.i b/Examples/test-suite/operator_overload.i
index ce3454fd9..43967bcc9 100644
--- a/Examples/test-suite/operator_overload.i
+++ b/Examples/test-suite/operator_overload.i
@@ -79,8 +79,8 @@ see bottom for a set of possible tests
#endif
#ifdef SWIGD
-// Due to the way operator overloading is implemented in D1 and D2, the prefix
-// increment/decrement operators (D1) resp. the postfix ones (D2) are ignored.
+// Due to the way operator overloading is implemented in D2, the postfix
+// increment/decrement operators are ignored.
%warnfilter(SWIGWARN_IGNORE_OPERATOR_PLUSPLUS, SWIGWARN_IGNORE_OPERATOR_MINUSMINUS);
#endif
diff --git a/Lib/d/dhead.swg b/Lib/d/dhead.swg
index 3d502ffc7..5e8c7bc1d 100644
--- a/Lib/d/dhead.swg
+++ b/Lib/d/dhead.swg
@@ -162,7 +162,7 @@ private class SwigStringHelper {
static const(char)* createString(const(char*) cString) {
// We are effectively dup'ing the string here.
- // TODO: Is this also correct for D2/Phobos?
+ // TODO: Is this correct for D2/Phobos?
return std.string.toStringz(std.conv.to!string(cString));
}
}
diff --git a/Lib/d/dkw.swg b/Lib/d/dkw.swg
index 2a189ed64..b96d1fa6b 100644
--- a/Lib/d/dkw.swg
+++ b/Lib/d/dkw.swg
@@ -120,7 +120,7 @@ DKEYWORD(with);
DKEYWORD(wstring);
// Not really a keyword, but dispose() methods are generated in proxy classes
-// and it's a special method name for D1/Tango.
+// and it was a special method name for D1/Tango.
DKEYWORD(dispose);
#undef DKEYWORD
diff --git a/RELEASENOTES b/RELEASENOTES
index 300e79c09..f9cfcad06 100644
--- a/RELEASENOTES
+++ b/RELEASENOTES
@@ -9,6 +9,7 @@ published on the SWIG web site at https://swig.org/release.html.
SWIG-4.2.0 summary:
- PHP7 support removed, PHP8 is now the supported PHP version.
+- D1/Tango support removed. D2/Phobos is now the supported D version.
SWIG-4.1.1 summary:
- Couple of stability fixes.