Check-in [a431979fb3]
Overview
Comment:Updated to deal with FreeBSD headers with respect to va_args
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a431979fb3936ac3100792942a139a4e339e928d
User & Date: rkeene on 2016-01-25 20:30:49
Other Links: manifest | tags
Context
2016-03-20
07:50
Updated to make dlclose more workable on win32 when building statically check-in: 50ae80c10b user: rkeene tags: trunk
2016-01-25
20:30
Updated to deal with FreeBSD headers with respect to va_args check-in: a431979fb3 user: rkeene tags: trunk
20:30
Updated to use more universal hash-bang lines for scripts check-in: 634ad56305 user: rkeene tags: trunk
Changes

Modified patch-headers.sh from [d0c4a0c4ce] to [834bd68ab4].

    12     12   	print "#define __RENAME(x) no renaming on this platform"
    13     13   	next
    14     14   }
    15     15   {print}
    16     16   
    17     17   /^#warning /{ next }
    18     18   	' sys/cdefs.h > sys/cdefs.h.new
           19  +	rm -f sys/cdefs.h
    19     20   	cat sys/cdefs.h.new > sys/cdefs.h
    20     21   	rm -f sys/cdefs.h.new
    21     22   fi
    22     23   
    23     24   ## loff_t depends on __GNUC__ for some reason
    24     25   if awk -v retval=1 '/__GNUC__/{ getline; if ($0 ~ /__kernel_loff_t/) {retval=0} } END{exit retval}' asm/posix_types.h >/dev/null 2>/dev/null; then
    25     26   	awk '/__GNUC__/{ getline; if ($0 ~ /__kernel_loff_t/) { print "#if 1"; print; next } } { print }' asm/posix_types.h > asm/posix_types.h.new
           27  +	rm -f asm/posix_types.h
    26     28   	cat asm/posix_types.h.new > asm/posix_types.h
    27     29   	rm -f asm/posix_types.h.new
    28     30   fi
    29     31   
    30     32   # Busted wrapper fix-up
    31     33   if grep '__STDC_HOSTED__' stdint.h >/dev/null 2>/dev/null && grep '_GCC_WRAP_STDINT_H' stdint.h >/dev/null 2>/dev/null; then
    32     34   	echo '#include_next <stdint.h>' > stdint.h
    33     35   fi
    34     36   
    35     37   if grep '__CLANG_LIMITS_H' limits.h >/dev/null 2>/dev/null; then
    36     38   	echo '#include_next <limits.h>' > limits.h
    37     39   fi
    38     40   
    39         -# MUSL libc expects GCC
    40         -if grep ' __builtin_va_list ' bits/alltypes.h >/dev/null 2>/dev/null; then
    41         -	sed 's@ __builtin_va_list @ char * @' bits/alltypes.h > bits/alltypes.h.new
    42         -	cat bits/alltypes.h.new > bits/alltypes.h
    43         -	rm -f bits/alltypes.h.new
           41  +# MUSL libc expects GCC (bits/alltypes.h)
           42  +# FreeBSD expects some GCCisms (x86/_types.h)
           43  +for file in bits/alltypes.h x86/_types.h; do
           44  +	if grep '[[:space:]]__builtin_va_list[[:space:]]' "${file}" >/dev/null 2>/dev/null; then
           45  +		sed 's@[[:space:]]__builtin_va_list[[:space:]]@ char * @' "${file}" > "${file}.new"
           46  +		rm -f "${file}"
           47  +		cat "${file}.new" > "${file}"
           48  +		rm -f "${file}.new"
           49  +	fi
           50  +done
           51  +
           52  +if grep __GNUCLIKE_BUILTIN_VARARGS x86/_types.h >/dev/null 2>/dev/null; then
           53  +	sed '/__GNUCLIKE_BUILTIN_VARARGS/ {h;s/.*/typedef char * __va_list;/;p;g;}' x86/_types.h > x86/_types.h.new
           54  +	rm -f x86/_types.h
           55  +	cat x86/_types.h.new > x86/_types.h
           56  +	rm -f x86/_types.h.new
    44     57   fi