From ee2ce6a1b01111358e4feb1d8bd1c945dc3a2f32 Mon Sep 17 00:00:00 2001 From: Wolfgang Thaller Date: Wed, 15 Jun 2016 22:41:47 +0200 Subject: [PATCH] fix header file filtering --- prepare-headers.sh | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/prepare-headers.sh b/prepare-headers.sh index 0d865d1c7e..35e9bc20ce 100644 --- a/prepare-headers.sh +++ b/prepare-headers.sh @@ -5,17 +5,51 @@ OUT=$2 export LANG=en for file in $(cd $IN; ls *.h); do - case file in - errno.h|fcntl.h|fenv.h|fstream.h|handler.h|headers.h|FSpio.h) + # Filter by file names. + # Some CIncludes packages include the MPW standard library. + # Header files from that standard library would overwrite + # newlib header files and stop things from working. + case $file in + # Apple/MPW standard library internals + *Def.h|FSpio.h) + USE=false ;; - ioctl.h|iomanip.h|iostream.h|limits.h|locale.h|math.h|new.h) + + # whitelist all uppercase headers + [A-Z]*.h) + USE=true ;; - sejmp.h|signal.h|std*.h|string.h|strstream.h|time.h|typeinfo.h) + + # whitelist OpenTransport + cred.h|dlpi.h|miioccom.h|mistream.h|modnames.h) + USE=true ;; + # whitelist OpenTransport (continued) + strlog.h|stropts.h|strstat.h|tihdr.h) + USE=true + ;; + + # Non-standard floating point headers that don't conflict + ddrt.h|fp.h) + USE=true + ;; + + # veclib headers + v*.h) + USE=true + ;; + + # unsupported: intrinsics.h perf.h + + # all other (lowercase) headers: conflict with GCC or newlib headers *) - tr '\r' '\n' < $IN/$file > $OUT/$file + USE=false ;; esac + + if [ $USE = true ]; then + tr '\r' '\n' < $IN/$file > $OUT/$file + fi done ############################# ConditionalMacros.h #############################