Revert "[Tizen] fix crash caused by callback null" 78/153378/1
authorJinho, Lee <jeano.lee@samsung.com>
Thu, 28 Sep 2017 05:51:08 +0000 (14:51 +0900)
committerJinho, Lee <jeano.lee@samsung.com>
Thu, 28 Sep 2017 05:51:10 +0000 (14:51 +0900)
This reverts commit 3ba89b4e71aaab7a25c82f3dd58744471fa66150.

Change-Id: If6de85b98295c6b8c3b954dbbe6acaf0078ec86a

dali-csharp-binder/src/common.h [changed mode: 0755->0644]
dali-csharp-binder/src/dali_wrap.cpp

old mode 100755 (executable)
new mode 100644 (file)
index 2418cf4..9f8d237
@@ -144,17 +144,85 @@ typedef struct
   SWIG_CSharpExceptionArgumentCallback_t callback;
 } SWIG_CSharpExceptionArgument_t;
 
-extern SWIG_CSharpException_t SWIG_csharp_exceptions[];
-
-extern SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[];
-
-extern void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg);
+static SWIG_CSharpException_t SWIG_csharp_exceptions[] =
+{
+  { SWIG_CSharpApplicationException, NULL },
+  { SWIG_CSharpArithmeticException, NULL },
+  { SWIG_CSharpDivideByZeroException, NULL },
+  { SWIG_CSharpIndexOutOfRangeException, NULL },
+  { SWIG_CSharpInvalidCastException, NULL },
+  { SWIG_CSharpInvalidOperationException, NULL },
+  { SWIG_CSharpIOException, NULL },
+  { SWIG_CSharpNullReferenceException, NULL },
+  { SWIG_CSharpOutOfMemoryException, NULL },
+  { SWIG_CSharpOverflowException, NULL },
+  { SWIG_CSharpSystemException, NULL }
+};
 
-extern void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name);
+static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] =
+{
+  { SWIG_CSharpArgumentException, NULL },
+  { SWIG_CSharpArgumentNullException, NULL },
+  { SWIG_CSharpArgumentOutOfRangeException, NULL }
+};
 
-extern void SWIG_CSharpException(int code, const char *msg);
+static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg)
+{
+  SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback;
+  if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t))
+  {
+    callback = SWIG_csharp_exceptions[code].callback;
+  }
+  callback(msg);
+}
 
+static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) {
+  SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback;
+  if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) {
+    callback = SWIG_csharp_exceptions_argument[code].callback;
+  }
+  callback(msg, param_name);
+}
 
+SWIGINTERN void SWIG_CSharpException(int code, const char *msg)
+{
+  if (code == SWIG_ValueError)
+  {
+    SWIG_CSharpExceptionArgumentCodes exception_code = SWIG_CSharpArgumentOutOfRangeException;
+    SWIG_CSharpSetPendingExceptionArgument(exception_code, msg, 0);
+  }
+  else
+  {
+    SWIG_CSharpExceptionCodes exception_code = SWIG_CSharpApplicationException;
+    switch(code)
+    {
+      case SWIG_MemoryError:
+        exception_code = SWIG_CSharpOutOfMemoryException;
+        break;
+      case SWIG_IndexError:
+        exception_code = SWIG_CSharpIndexOutOfRangeException;
+        break;
+      case SWIG_DivisionByZero:
+        exception_code = SWIG_CSharpDivideByZeroException;
+        break;
+      case SWIG_IOError:
+        exception_code = SWIG_CSharpIOException;
+        break;
+      case SWIG_OverflowError:
+        exception_code = SWIG_CSharpOverflowException;
+        break;
+      case SWIG_RuntimeError:
+      case SWIG_TypeError:
+      case SWIG_SyntaxError:
+      case SWIG_SystemError:
+      case SWIG_UnknownError:
+      default:
+        exception_code = SWIG_CSharpApplicationException;
+        break;
+    }
+    SWIG_CSharpSetPendingException(exception_code, msg);
+  }
+}
 
 #include <stdexcept>
 
index 88a36d7..3cb7dc2 100755 (executable)
@@ -204,7 +204,7 @@ typedef struct {
   SWIG_CSharpExceptionArgumentCallback_t callback;
 } SWIG_CSharpExceptionArgument_t;
 
-SWIG_CSharpException_t SWIG_csharp_exceptions[] = {
+static SWIG_CSharpException_t SWIG_csharp_exceptions[] = {
   { SWIG_CSharpApplicationException, NULL },
   { SWIG_CSharpArithmeticException, NULL },
   { SWIG_CSharpDivideByZeroException, NULL },
@@ -218,13 +218,13 @@ SWIG_CSharpException_t SWIG_csharp_exceptions[] = {
   { SWIG_CSharpSystemException, NULL }
 };
 
-SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = {
+static SWIG_CSharpExceptionArgument_t SWIG_csharp_exceptions_argument[] = {
   { SWIG_CSharpArgumentException, NULL },
   { SWIG_CSharpArgumentNullException, NULL },
   { SWIG_CSharpArgumentOutOfRangeException, NULL }
 };
 
-void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) {
+static void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, const char *msg) {
   SWIG_CSharpExceptionCallback_t callback = SWIG_csharp_exceptions[SWIG_CSharpApplicationException].callback;
   if ((size_t)code < sizeof(SWIG_csharp_exceptions)/sizeof(SWIG_CSharpException_t)) {
     callback = SWIG_csharp_exceptions[code].callback;
@@ -232,7 +232,7 @@ void SWIGUNUSED SWIG_CSharpSetPendingException(SWIG_CSharpExceptionCodes code, c
   callback(msg);
 }
 
-void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) {
+static void SWIGUNUSED SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpExceptionArgumentCodes code, const char *msg, const char *param_name) {
   SWIG_CSharpExceptionArgumentCallback_t callback = SWIG_csharp_exceptions_argument[SWIG_CSharpArgumentException].callback;
   if ((size_t)code < sizeof(SWIG_csharp_exceptions_argument)/sizeof(SWIG_CSharpExceptionArgument_t)) {
     callback = SWIG_csharp_exceptions_argument[code].callback;
@@ -378,7 +378,7 @@ namespace Swig {
 }
 
 
-void SWIG_CSharpException(int code, const char *msg) {
+SWIGINTERN void SWIG_CSharpException(int code, const char *msg) {
   if (code == SWIG_ValueError) {
     SWIG_CSharpExceptionArgumentCodes exception_code = SWIG_CSharpArgumentOutOfRangeException;
     SWIG_CSharpSetPendingExceptionArgument(exception_code, msg, 0);