summaryrefslogtreecommitdiff
path: root/Lib/std_except.i
diff options
context:
space:
mode:
authorMarcelo Matus <mmatus@acms.arizona.edu>2006-01-06 01:49:10 +0000
committerMarcelo Matus <mmatus@acms.arizona.edu>2006-01-06 01:49:10 +0000
commit33b23a6965e3656e7bd500e0c74aa4f4af7d03d6 (patch)
treeaf1c4cc0f2bdb3183491f7892511728296d73495 /Lib/std_except.i
parent4118509a84049323343ffb89c3231ecd972a82ca (diff)
downloadswig-33b23a6965e3656e7bd500e0c74aa4f4af7d03d6.tar.gz
clarify the use of std_except.i, now it has nothing to do with supporting the STD/STL namespace
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8236 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/std_except.i')
-rw-r--r--Lib/std_except.i48
1 files changed, 18 insertions, 30 deletions
diff --git a/Lib/std_except.i b/Lib/std_except.i
index 776d1b8f4..1720f0633 100644
--- a/Lib/std_except.i
+++ b/Lib/std_except.i
@@ -1,46 +1,36 @@
-#if defined(SWIGJAVA)
-%include <java/std_except.i>
-#elif defined(SWIGCSHARP)
-%include <csharp/std_except.i>
-#else
-
-
-/* avoid to include std/std_except.i unless we really need it */
-#if !defined(SWIG_STD_EXCEPTIONS_AS_CLASSES)
-%{
-#include <stdexcept>
-%}
-#else
-%include <std/std_except.i>
-#endif
-
-
-// Typemaps used by the STL wrappers that throw exceptions.
-// These typemaps are used when methods are declared with an STL
+// Typemaps used to handle and throw STD exceptions in a language
+// and STL independent way, i.e., the target language doesn't
+// require to support STL but only the 'exception.i' mechanism.
+//
+// These typemaps are used when methods are declared with an STD
// exception specification, such as
//
// size_t at() const throw (std::out_of_range);
//
+//
+// As was said, the typemaps here are based in the language independent
+// 'exception.i' library. If that is working in your target language,
+// this file will work.
+//
+// If the target language doesn't implement a robust 'exception.i'
+// mechanism, or you prefer other ways to map the STD exceptions, write
+// a new std_except.i file in the target library directory.
+//
+
+%{
+#include <stdexcept>
+%}
%include <exception.i>
-/*
- Mark all of std exception classes as "exception classes" via
- the "exceptionclass" feature.
-
- If needed, you can disable it by using %noexceptionclass.
-*/
%define %std_exception_map(Exception, Code)
- %exceptionclass Exception;
-#if !defined(SWIG_STD_EXCEPTIONS_AS_CLASSES)
%typemap(throws,noblock=1) Exception {
SWIG_exception(Code, $1.what());
}
%ignore Exception;
struct Exception {
};
-#endif
%enddef
namespace std {
@@ -57,5 +47,3 @@ namespace std {
%std_exception_map(underflow_error, SWIG_OverflowError);
}
-#endif
-