eo-cxx: Replace C++ throw with EFL_CXX_THROW.
authorSavio S. Machado <savio.sena@acm.org>
Mon, 13 Oct 2014 10:45:34 +0000 (07:45 -0300)
committerSavio S. Machado <savio.sena@acm.org>
Mon, 13 Oct 2014 10:45:34 +0000 (07:45 -0300)
src/bindings/eo_cxx/eo_base.hh

index 015fd51..020816a 100644 (file)
 #include "eo_ops.hh"
 #include "eo_event.hh"
 
+#ifndef EFL_CXX_THROW
+#if defined ( EFL_CXX_NO_EXCEPTIONS )
+# define EFL_CXX_THROW(x)    std::abort()
+#else
+# define EFL_CXX_THROW(x)    throw (x)
+#endif
+#endif
 
 namespace efl { namespace eo {
 
@@ -276,7 +283,7 @@ T downcast(U object)
      }
    else
      {
-        throw std::runtime_error("Invalid cast");
+        EFL_CXX_THROW(std::runtime_error("Invalid cast"));
      }
 }