dali native version check 81/121981/2
authordongsug.song <dongsug.song@samsung.com>
Wed, 29 Mar 2017 23:30:04 +0000 (08:30 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Thu, 30 Mar 2017 00:54:38 +0000 (09:54 +0900)
Signed-off-by: dongsug.song <dongsug.song@samsung.com>
Change-Id: I21cc9c4f382a93a8f9c47bbc8ad0bd9fb5ad38ff

dali-csharp-binder/file.list
dali-csharp-binder/src/version-check.cpp [new file with mode: 0755]

index 7deef5c..c53bd0e 100755 (executable)
@@ -7,7 +7,8 @@ dali_csharp_binder_src_files = \
   src/callbackbase_wrap.cpp \
   src/keyboard_focus_manager_wrap.cpp \
   src/devel-property-wrap.cpp \
-  src/view-wrapper-impl-wrap.cpp 
+  src/version-check.cpp \
+  src/view-wrapper-impl-wrap.cpp
 
 dali_csharp_binder_header_files = \
   src/common.h
diff --git a/dali-csharp-binder/src/version-check.cpp b/dali-csharp-binder/src/version-check.cpp
new file mode 100755 (executable)
index 0000000..0f95a80
--- /dev/null
@@ -0,0 +1,49 @@
+/** Copyright (c) 2017 Samsung Electronics Co., Ltd.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+#include "common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_NativeVersionCheck(int * ver1, int * ver2, int * ver3 ) {
+  {
+    try {
+      *ver1 = Dali::CORE_MAJOR_VERSION;
+      *ver2 = Dali::CORE_MINOR_VERSION;
+      *ver3 = Dali::CORE_MICRO_VERSION;
+    } catch (std::out_of_range& e) {
+      {
+        SWIG_CSharpException(SWIG_IndexError, const_cast<char*>(e.what())); return false;
+      };
+    } catch (std::exception& e) {
+      {
+        SWIG_CSharpException(SWIG_RuntimeError, const_cast<char*>(e.what())); return false;
+      };
+    } catch (...) {
+      {
+        SWIG_CSharpException(SWIG_UnknownError, "unknown error"); return false;
+      };
+    }
+  }
+  return true;
+}
+
+#ifdef __cplusplus
+}
+#endif
+