From 4e2c70a55fa9ba0128a5942b66d5f3e34f0e4c8f Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Thu, 13 Oct 2005 09:18:40 +0000 Subject: [PATCH] implement the #warning/#error cpp directives git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7644 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Preprocessor/cpp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Source/Preprocessor/cpp.c b/Source/Preprocessor/cpp.c index dff2ad492..58a161c7d 100644 --- a/Source/Preprocessor/cpp.c +++ b/Source/Preprocessor/cpp.c @@ -1385,6 +1385,14 @@ Preprocessor_parse(String *s) } } } + } else if (Cmp(id,"warning") == 0) { + if (allow) { + Swig_warning(WARN_PP_CPP_WARNING,Getfile(s),Getline(id),"%s\n", value); + } + } else if (Cmp(id,"error") == 0) { + if (allow) { + Swig_error(Getfile(s),Getline(id),"%s\n",value); + } } else if (Cmp(id,"line") == 0) { } else if (Cmp(id,"include") == 0) { if (((include_all) || (import_all)) && (allow)) {