From 4c86ed4980d0f277dc4b9194fa9178d7881a669c Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Tue, 1 Oct 2019 08:05:35 +0100 Subject: [PATCH] Macros wrapped as constants documentation improvements. Closes #1618 --- Doc/Manual/SWIG.html | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html index aec48ef03..c54d117e0 100644 --- a/Doc/Manual/SWIG.html +++ b/Doc/Manual/SWIG.html @@ -826,6 +826,32 @@ However, for the same conservative reasons even a constant with a simple cast wi +

+This logic can lead to false attempts at converting #define into %constant though. +For example the following case does not have any undefined symbols within the macro: +

+ +
+
+// For indicating pure virtual functions such as: virtual void f() PURE;
+#define PURE = 0
+
+
+ +

+A warning is issued: +

+ +
+
+pure.h:1: Warning 305: Bad constant value (ignored).
+
+
+ +

+In such cases simply ignore the warning or suppress it using the normal warning suppression techniques. +

+

The use of constant expressions is allowed, but SWIG does not evaluate them. Rather, it passes them through to the output file and lets the C