File tree 4 files changed +55
-0
lines changed
4 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Go cross compiler (xgo): Test file for embedded C snippets.
2
+ // Copyright (c) 2015 Péter Szilágyi. All rights reserved.
3
+ //
4
+ // Released under the MIT license.
5
+
6
+ package main
7
+
8
+ // #include <stdio.h>
9
+ //
10
+ // void sayHi() {
11
+ // printf("Hello, embedded C!\n");
12
+ // }
13
+ import "C"
14
+
15
+ func main () {
16
+ C .sayHi ()
17
+ }
Original file line number Diff line number Diff line change
1
+ // Go cross compiler (xgo): Test file for embedded C++ snippets.
2
+ // Copyright (c) 2015 Péter Szilágyi. All rights reserved.
3
+ //
4
+ // Released under the MIT license.
5
+
6
+ package main
7
+
8
+ // #include "snippet.h"
9
+ import "C"
10
+
11
+ func main () {
12
+ C .sayHi ()
13
+ }
Original file line number Diff line number Diff line change
1
+ // Go cross compiler (xgo): Test implementation for embedded C++ snippets.
2
+ // Copyright (c) 2015 Péter Szilágyi. All rights reserved.
3
+ //
4
+ // Released under the MIT license.
5
+
6
+ #include < iostream>
7
+ #include " snippet.h"
8
+
9
+ void sayHi () {
10
+ std::cout << " Hello, embedded C++!" << std::endl;
11
+ }
Original file line number Diff line number Diff line change
1
+ // Go cross compiler (xgo): Test header for embedded C++ snippets.
2
+ // Copyright (c) 2015 Péter Szilágyi. All rights reserved.
3
+ //
4
+ // Released under the MIT license.
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ void sayHi ();
11
+
12
+ #ifdef __cplusplus
13
+ }
14
+ #endif
You can’t perform that action at this time.
0 commit comments