diff options
| author | ruki <[email protected]> | 2022-12-01 22:39:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-12-01 22:39:39 +0800 |
| commit | 0914303fc89e25e51e71a7a628e41578993dcb6d (patch) | |
| tree | 57af39617ca2d0816fc3f9ffc8f8830bab9c1f42 /xmake/templates/c++/shared/project/src | |
| parent | 90613a344570916a4a7d197dc20d3af31a38be51 (diff) | |
improve templates
Diffstat (limited to 'xmake/templates/c++/shared/project/src')
| -rw-r--r-- | xmake/templates/c++/shared/project/src/foo.cpp | 5 | ||||
| -rw-r--r-- | xmake/templates/c++/shared/project/src/foo.h (renamed from xmake/templates/c++/shared/project/src/interface.h) | 9 | ||||
| -rw-r--r-- | xmake/templates/c++/shared/project/src/interface.cpp | 6 | ||||
| -rw-r--r-- | xmake/templates/c++/shared/project/src/main.cpp | 5 |
4 files changed, 8 insertions, 17 deletions
diff --git a/xmake/templates/c++/shared/project/src/foo.cpp b/xmake/templates/c++/shared/project/src/foo.cpp new file mode 100644 index 000000000..1a1fb3425 --- /dev/null +++ b/xmake/templates/c++/shared/project/src/foo.cpp @@ -0,0 +1,5 @@ +#include "foo.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/templates/c++/shared/project/src/interface.h b/xmake/templates/c++/shared/project/src/foo.h index 57b6194de..20df0baa4 100644 --- a/xmake/templates/c++/shared/project/src/interface.h +++ b/xmake/templates/c++/shared/project/src/foo.h @@ -10,14 +10,7 @@ extern "C" { # define __export #endif -/*! calculate add(a, b) - * - * @param a the first argument - * @param b the second argument - * - * @return the result - */ -__export int add(int a, int b); +__export int add(int a, int b); #ifdef __cplusplus } diff --git a/xmake/templates/c++/shared/project/src/interface.cpp b/xmake/templates/c++/shared/project/src/interface.cpp deleted file mode 100644 index 598d07560..000000000 --- a/xmake/templates/c++/shared/project/src/interface.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "interface.h" - -int add(int a, int b) -{ - return a + b; -} diff --git a/xmake/templates/c++/shared/project/src/main.cpp b/xmake/templates/c++/shared/project/src/main.cpp index 1bee1b2ad..ed1924789 100644 --- a/xmake/templates/c++/shared/project/src/main.cpp +++ b/xmake/templates/c++/shared/project/src/main.cpp @@ -1,10 +1,9 @@ -#include "interface.h" +#include "foo.h" #include <iostream> using namespace std; -int main(int argc, char** argv) -{ +int main(int argc, char** argv) { cout << "add(1, 2) = " << add(1, 2) << endl; return 0; } |
