summaryrefslogtreecommitdiff
path: root/tests/projects/swig/python_cpp/src/example.cpp
diff options
context:
space:
mode:
authorruki <[email protected]>2021-09-24 12:50:52 +0800
committerGitHub <[email protected]>2021-09-24 12:50:52 +0800
commit024183f9c98dd03f22384203238ba661a5714640 (patch)
tree9913cdd96df86f6f289a3afd57c63d5105201e0d /tests/projects/swig/python_cpp/src/example.cpp
parentfbccc2375dba05f227ff8e6ec0b61c9357ca449d (diff)
parent4a8694d08d48ebc4101cc1b35e88b3fffe56de59 (diff)
Merge pull request #1703 from xmake-io/swig
Support Swig
Diffstat (limited to 'tests/projects/swig/python_cpp/src/example.cpp')
-rw-r--r--tests/projects/swig/python_cpp/src/example.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/projects/swig/python_cpp/src/example.cpp b/tests/projects/swig/python_cpp/src/example.cpp
new file mode 100644
index 000000000..31c659bfa
--- /dev/null
+++ b/tests/projects/swig/python_cpp/src/example.cpp
@@ -0,0 +1,14 @@
+double My_variable = 3.0;
+
+/* Compute factorial of n */
+int fact(int n) {
+ if (n <= 1)
+ return 1;
+ else
+ return n*fact(n-1);
+}
+
+/* Compute n mod m */
+int my_mod(int n, int m) {
+ return(n % m);
+}