diff options
-rw-r--r-- | Doc/Manual/D.html | 4 | ||||
-rw-r--r-- | Examples/d/constants/example.i | 2 | ||||
-rw-r--r-- | Examples/test-suite/preproc_line_file.i | 2 | ||||
-rw-r--r-- | Examples/test-suite/static_const_member.i | 4 | ||||
-rw-r--r-- | Lib/d/ddirectives.swg | 2 | ||||
-rw-r--r-- | Source/Modules/d.cxx | 12 |
6 files changed, 13 insertions, 13 deletions
diff --git a/Doc/Manual/D.html b/Doc/Manual/D.html index 2b563788f..a232f236b 100644 --- a/Doc/Manual/D.html +++ b/Doc/Manual/D.html @@ -281,9 +281,9 @@ $importtype(AnotherInterface) <dl> - <dt><tt>%dnativeconst</tt> and <tt>%dconstvalue(value)</tt></dt> + <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>%dnativeconst</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>const</tt> in D1, <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 wrapper 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> diff --git a/Examples/d/constants/example.i b/Examples/d/constants/example.i index 5eb541919..edeb258cd 100644 --- a/Examples/d/constants/example.i +++ b/Examples/d/constants/example.i @@ -4,7 +4,7 @@ /* Force the generated D code to use the C constant values rather than retrieving them at runtime. You can also try disabling the feature and compare the generated code. */ -%dnativeconst; +%dmanifestconst; /* A few preprocessor macros */ diff --git a/Examples/test-suite/preproc_line_file.i b/Examples/test-suite/preproc_line_file.i index 91ff2133e..b221b7728 100644 --- a/Examples/test-suite/preproc_line_file.i +++ b/Examples/test-suite/preproc_line_file.i @@ -34,7 +34,7 @@ const int NUMBER_UNIQUE(thing) = -2; /* resolves to thing28 */ #elif defined(SWIGCSHARP) %csconst(1); #elif defined(SWIGD) -%dnativeconst; +%dmanifestconst; #else %ignore LINE_NUMBER; %ignore LINE_NUM; diff --git a/Examples/test-suite/static_const_member.i b/Examples/test-suite/static_const_member.i index 945e28490..a8d119b81 100644 --- a/Examples/test-suite/static_const_member.i +++ b/Examples/test-suite/static_const_member.i @@ -12,8 +12,8 @@ %csconst(1) EN; %csconst(1) CHARTEST; #elif SWIGD -%dnativeconst EN; -%dnativeconst CHARTEST; +%dmanifestconst EN; +%dmanifestconst CHARTEST; #endif %inline %{ diff --git a/Lib/d/ddirectives.swg b/Lib/d/ddirectives.swg index 2b6ad77e2..f3052cb87 100644 --- a/Lib/d/ddirectives.swg +++ b/Lib/d/ddirectives.swg @@ -4,7 +4,7 @@ * D-specifiv directives. * ----------------------------------------------------------------------------- */ -#define %dnativeconst %feature("d:nativeconst") +#define %dmanifestconst %feature("d:manifestconst") #define %dconstvalue(value) %feature("d:constvalue",value) #define %dmethodmodifiers %feature("d:methodmodifiers") #define %dstripprefix %feature("d:stripprefix") diff --git a/Source/Modules/d.cxx b/Source/Modules/d.cxx index e3e1d9759..4f48275fc 100644 --- a/Source/Modules/d.cxx +++ b/Source/Modules/d.cxx @@ -864,7 +864,7 @@ public: String *value = Getattr(n, "feature:d:constvalue"); // Note that in D, enum values must be compile-time constants. Thus, - // %dnativeconst(0) (getting the enum values at runtime) is not supported. + // %dmanifestconst(0) (getting the enum values at runtime) is not supported. value = value ? value : Getattr(n, "enumvalue"); if (value) { Printf(proxy_enum_code, " = %s", value); @@ -976,7 +976,7 @@ public: * D::staticmembervariableHandler() * --------------------------------------------------------------------------- */ virtual int staticmembervariableHandler(Node *n) { - if (GetFlag(n, "feature:d:nativeconst") != 1) { + if (GetFlag(n, "feature:d:manifestconst") != 1) { Delattr(n, "value"); } @@ -1298,7 +1298,7 @@ public: * Used for wrapping constants declared by #define or %constant and also for * (primitive) static member constants initialised inline. * - * If the %dnativeconst feature is used, the C/C++ constant value is used to + * If the %dmanifestconst feature is used, the C/C++ constant value is used to * initialize a D »const«. If not, a »getter« method is generated which * retrieves the value via a call to the C wrapper. However, if there is a * %dconstvalue specified, it overrides all other settings. @@ -1308,9 +1308,9 @@ public: if (!addSymbol(symname, n)) return SWIG_ERROR; - // The %dnativeconst feature determines if a D const or a getter function is - // created. - if (GetFlag(n, "feature:d:nativeconst") != 1) { + // The %dmanifestconst feature determines if a D manifest constant + // (const/enum) or a getter function is created. + if (GetFlag(n, "feature:d:manifestconst") != 1) { // Default constant handling will work with any type of C constant. It // generates a getter function (which is the same as a read only property // in D) which retrieves the value via by calling the C wrapper. |