summaryrefslogtreecommitdiff
path: root/tests/static_library_c++/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/static_library_c++/src')
-rwxr-xr-xtests/static_library_c++/src/interface.cpp6
-rwxr-xr-xtests/static_library_c++/src/interface.h16
-rwxr-xr-xtests/static_library_c++/src/test.cpp10
3 files changed, 32 insertions, 0 deletions
diff --git a/tests/static_library_c++/src/interface.cpp b/tests/static_library_c++/src/interface.cpp
new file mode 100755
index 000000000..598d07560
--- /dev/null
+++ b/tests/static_library_c++/src/interface.cpp
@@ -0,0 +1,6 @@
+#include "interface.h"
+
+int add(int a, int b)
+{
+ return a + b;
+}
diff --git a/tests/static_library_c++/src/interface.h b/tests/static_library_c++/src/interface.h
new file mode 100755
index 000000000..4a41e9597
--- /dev/null
+++ b/tests/static_library_c++/src/interface.h
@@ -0,0 +1,16 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! calculate add(a, b)
+ *
+ * @param a the first argument
+ * @param b the second argument
+ *
+ * @return the result
+ */
+int add(int a, int b);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/tests/static_library_c++/src/test.cpp b/tests/static_library_c++/src/test.cpp
new file mode 100755
index 000000000..72e03272b
--- /dev/null
+++ b/tests/static_library_c++/src/test.cpp
@@ -0,0 +1,10 @@
+#include "interface.h"
+#include <iostream>
+
+using namespace std;
+
+int main(int argc, char** argv)
+{
+ cout << "add(1, 2) = " << add(1, 2) << endl;
+ return 0;
+}