mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 11:12:44 +01:00
1425dc0652
The script to fix the vendor header files has been renamed to `fix_headers.sh` and now does two things: 1. Strip bogus type qualifiers in front of padding (as before) 2. Strip bogus `LITTLE_ENDIAN` defines.
30 lines
1.1 KiB
Bash
Executable File
30 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# This function removes type qualifiers from anonymous padding fields in bit
|
|
# fields for compatibility with clang++.
|
|
strip_type_qualifiers_from_bit_fields() {
|
|
echo "Searching for header files with bogus type qualifiers"
|
|
offenders="$(grep -Erl '__I [u]*int[0-9]*_t[ \t]*:[0-9]*;')"
|
|
|
|
for file in $offenders; do
|
|
echo "Sanitizing $file for type qualifiers in padding"
|
|
sed -i "$file" -e 's/__I \([u]*int[0-9]*_t[\t ]*:[0-9]*;\)/\1 /g'
|
|
done
|
|
}
|
|
|
|
# This functions removes a bogus `LITTLE_ENDIAN` define which conflicts with
|
|
# <endian.h> and tinyDTLS notion of it. Luckily, that define is not used
|
|
# anywhere in the vendor header files, so we can just drop it.
|
|
remove_bogus_endian_define() {
|
|
echo "Searching for header files with bogus LITTLE_ENDIAN define"
|
|
offenders="$(grep -rl '^#define LITTLE_ENDIAN')"
|
|
|
|
for file in $offenders; do
|
|
echo "Removing bogus LITTLE_ENDIAN define from $file"
|
|
sed -i "$file" -e '/^#define LITTLE_ENDIAN/d'
|
|
done
|
|
}
|
|
|
|
strip_type_qualifiers_from_bit_fields
|
|
remove_bogus_endian_define
|