From a3d21b7b8e0784860df8d7ea7dc65664fb6dc9c7 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sun, 8 Jan 2006 10:12:35 +0000 Subject: document #error and #warning including cpperraswarn/nocpperraswarn git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8297 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Doc/Manual/Preprocessor.html | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'Doc/Manual/Preprocessor.html') diff --git a/Doc/Manual/Preprocessor.html b/Doc/Manual/Preprocessor.html index d7ae07e96..db1ea6f37 100644 --- a/Doc/Manual/Preprocessor.html +++ b/Doc/Manual/Preprocessor.html @@ -19,6 +19,7 @@
  • Preprocessing and %{ ... %} blocks
  • Preprocessing and { ... }
  • Viewing preprocessor output +
  • The #error and #warning directives @@ -381,5 +382,34 @@ Instead the results after the preprocessor has run are displayed. This might be useful as an aid to debugging and viewing the results of macro expansions.

    +

    7.10 The #error and #warning directives

    +

    +SWIG supports the commonly used #warning and #error preprocessor directives. +The #warning directive will cause SWIG to issue a warning then continue processing. +The #error directive will cause SWIG to exit with a fatal error. +Example usage: +

    + +
    +
    +#error "This is a fatal error message"
    +#warning "This is a warning message"
    +
    +
    + +

    +The #error behaviour can be made to work like #warning if the -cpperraswarn +commandline option is used. Alternatively, the #pragma directive can be used to the same effect, for example: +

    + +
    +
    +  /* Modified behaviour: #error does not cause SWIG to exit with error */
    +  #pragma SWIG cpperraswarn=1
    +  /* Normal behaviour: #error does cause SWIG to exit with error */
    +  #pragma SWIG cpperraswarn=0
    +
    +
    + -- cgit v1.2.3