Skip to content

Commit d261a33

Browse files
committed
clang support
1 parent ddb6a85 commit d261a33

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
testapp
2+
testapp-clang
23

34
# Prerequisites
45
*.d

build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ cd ..
77
mv lib/*.so .
88

99
g++ -std=c++14 -L. -ltest -Wl,-rpath='${ORIGIN}' -o testapp testapp.cpp
10+
clang++ -std=c++14 -L. -ltest-clang -Wl,-rpath='${ORIGIN}' -o testapp-clang testapp.cpp
1011

lib/Test.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ void printStructInfo11();
1515

1616
struct A2
1717
{
18-
uint16_t m{3};
18+
uint16_t m { 65535 };
1919
bool n;
2020
};
2121

2222
struct B2 : public A2
2323
{
2424
bool o;
25+
2526
};
2627

2728
void printStruct2Info11();

lib/build.sh

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
#!/bin/bash
22
g++ -std=c++11 -fPIC -c -o mytest.o Test.cpp
33
gcc -shared -o libtest.so mytest.o
4+
5+
clang++ -std=c++11 -fPIC -c -o mytest-clang.o Test.cpp
6+
clang++ -shared -o libtest-clang.so mytest.o
7+

testapp.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ void printStruct2Info14()
3535
int main()
3636
{
3737

38+
std::cout << "\n*********** Type 1\n";
3839
printStructInfo11();
3940
printStructInfo14();
4041

42+
std::cout << "\n*********** Type 2\n";
43+
4144
printStruct2Info11();
4245
printStruct2Info14();
4346
}

0 commit comments

Comments
 (0)