File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,8 +4,29 @@ output=$(./simplecpp simplecpp.cpp -e -f 2>&1)
44ec=$?
55errors=$( echo " $output " | grep -v ' Header not found: <' )
66if [ $ec -ne 0 ]; then
7- # only fail if got errors which do not refer to missing system includes
7+ # only fail if we got errors which do not refer to missing system includes
88 if [ ! -z " $errors " ]; then
99 exit $ec
1010 fi
11+ fi
12+
13+ # on macOS gcc is an alias for clang
14+ gcc_type=$( gcc --version | head -1 | cut -d' ' -f1)
15+ if [ " $gcc_type " = " gcc" ]; then
16+ gcc_ver=$( gcc -dumpversion)
17+ ./simplecpp simplecpp.cpp -e -f -D__GNUC__ -D__STDC__ -D__STDC_HOSTED__ -D__CHAR_BIT__=8 -I" /usr/include" -I" /usr/include/linux" -I" /usr/include/c++/$gcc_ver " -I" /usr/include/c++/$gcc_ver /x86_64-pc-linux-gnu" -I" /usr/lib64/gcc/x86_64-pc-linux-gnu/$gcc_ver /include"
18+ ec=$?
19+ if [ $ec -ne 0 ]; then
20+ exit $ec
21+ fi
22+ fi
23+
24+ if [ -d " /usr/include/c++/v1" ]; then
25+ # clang_ver=$(clang -dumpversion)
26+ # clang_ver=${clang_ver%%.*}
27+ ./simplecpp simplecpp.cpp -e -f -D__BYTE_ORDER__ -I" /usr/include/c++/v1"
28+ ec=$?
29+ if [ $ec -ne 0 ]; then
30+ exit $ec
31+ fi
1132fi
You can’t perform that action at this time.
0 commit comments