Skip to content

Commit b5b8b85

Browse files
committed
mingw
1 parent 03ec025 commit b5b8b85

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

selfcheck.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,46 @@ if [ "$cxx_type" = "Ubuntu" ] || [ "$cxx_type" = "Debian" ]; then
2020
fi
2121

2222
# TODO: generate defines from compiler
23-
if [ "$cxx_type" = "g++" ]; then
23+
if [ "$cxx_type" = "g++" ] || [ "$cxx_type" = "g++.exe" ]; then
2424
defs=
2525
defs="$defs -D__GNUC__"
2626
defs="$defs -D__STDC__"
2727
defs="$defs -D__x86_64__"
2828
defs="$defs -D__STDC_HOSTED__"
2929
defs="$defs -D__CHAR_BIT__=8"
30+
if [ "${MSYSTEM}" = "MINGW32" ] || [ "${MSYSTEM}" = "MINGW64" ]; then
31+
defs="$defs -D_WIN32"
32+
fi
3033
defs="$defs -D__has_builtin(x)=(1)"
3134
defs="$defs -D__has_cpp_attribute(x)=(1)"
3235
defs="$defs -D__has_attribute(x)=(1)"
36+
defs="$defs -Ddefined(x)=(0)"
3337

3438
inc=
3539
while read line
3640
do
3741
inc="$inc -I$line"
3842
done <<< "$($CXX -x c++ -v -c -S - 2>&1 < /dev/null | grep -e'^ [/A-Z]' | grep -v /cc1plus)"
3943
elif [ "$cxx_type" = "clang" ]; then
44+
cat C:/msys64/clang64/include/c++/v1/bitset
4045
# libstdc++
4146
defs=
4247
defs="$defs -D__x86_64__"
4348
defs="$defs -D__STDC_HOSTED__"
4449
defs="$defs -D__CHAR_BIT__=8"
50+
defs="$defs -D__BYTE_ORDER__=1234"
51+
defs="$defs -D__SIZEOF_SIZE_T__=8"
52+
if [ "${MSYSTEM}" = "MINGW32" ] || [ "${MSYSTEM}" = "MINGW64" ] || [ "${MSYSTEM}" = "CLANG64" ]; then
53+
defs="$defs -D_WIN32"
54+
fi
4555
defs="$defs -D__has_builtin(x)=(1)"
4656
defs="$defs -D__has_cpp_attribute(x)=(1)"
4757
defs="$defs -D__has_feature(x)=(1)"
48-
defs="$defs -D__has_include_next(x)=(0)"
58+
defs="$defs -D__has_include_next(x)=(1)"
4959
defs="$defs -D__has_attribute(x)=(0)"
5060
defs="$defs -D__building_module(x)=(0)"
61+
defs="$defs -D__has_extension(x)=(1)"
62+
defs="$defs -Ddefined(x)=(0)"
5163

5264
inc=
5365
while read line

0 commit comments

Comments
 (0)