From ecdb6647b73e209cfc1c5434f70f5a5c253dc59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 8 May 2018 12:45:11 +0300 Subject: [PATCH] windres: Remove the rc filtering in the wrapper shell script llvm-rc does this filtering internally now. --- README.md | 3 +-- wrappers/windres-wrapper.sh | 37 +------------------------------------ 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 2abf987..9006308 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,6 @@ normal GCC/binutils based MinGW. - The C++ exception unwinding in libunwind uses APIs that aren't available in the UWP/WinRT API subset. - The windres replacement, llvm-rc, isn't very mature and doesn't support - everything that GNU windres does. Additionally, some part of the preprocessing - is currently implemented in shell script, making it a bit slow. + everything that GNU windres does. Additionally, one may run into other minor differences between GCC and clang. diff --git a/wrappers/windres-wrapper.sh b/wrappers/windres-wrapper.sh index a5ffcdb..d30baa4 100755 --- a/wrappers/windres-wrapper.sh +++ b/wrappers/windres-wrapper.sh @@ -189,42 +189,7 @@ case "${INPUT_FORMAT}" in # called with parameters like this: -DSTRING=\\\"1.2.3\\\" $CC -E $(echo $CPP_OPTIONS | sed 's/\\"/"/g') -xc -DRC_INVOKED=1 "${INPUT}" -o "${TMPDIR}/post.rc" || error "preprocessor failed" - # Parse the preprocessor output, looking for source file/line markers, - # and discard output from *.h files. This matches what rc.exe and binutils windres - # do. - IFS=' -' - output=0 - rm -f "${TMPDIR}/in.rc" - for line in $(cat "${TMPDIR}/post.rc"); do - case $line in - \#\ *|\#line\ *) - file="$(echo "$line" | awk '{print $3}' | sed 's/^"//;s/"$//')" - case $file in - *.h) - output=0 - ;; - *) - output=1 - ;; - esac - ;; - \#*) - ;; - *) - if [ $output -ne 0 ]; then - # Plain "echo" affects potential quotes and escapes in the - # content, with posix sh. - cat<> "${TMPDIR}/in.rc" -$line -EOF - fi - ;; - esac - done - unset IFS - - llvm-rc $RC_OPTIONS "${TMPDIR}/in.rc" -c $CODEPAGE -fo "${TMPDIR}/in.res" + llvm-rc $RC_OPTIONS "${TMPDIR}/post.rc" -c $CODEPAGE -fo "${TMPDIR}/in.res" case "${OUTPUT_FORMAT}" in "res") cat "${TMPDIR}/in.res" > "${OUTPUT}"