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
    +
    +
    +