From 75ed7e61cd33a546a1d244b663e25a61303981a9 Mon Sep 17 00:00:00 2001
From: Martin Weinelt <mweinelt@users.noreply.github.com>
Date: Fri, 3 Jan 2025 19:20:36 +0100
Subject: [PATCH] Revert "pkgs/build-support: cc-wrapper.sh not detecting c++
 files by extension" (#370692)

This change broke Firefox, since it wasi-ld now fails to find its libc.
---
 pkgs/build-support/cc-wrapper/cc-wrapper.sh | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh
index e69f4331b0161..db1016ec99bee 100644
--- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh
+++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh
@@ -56,9 +56,6 @@ while (( "$n" < "$nParams" )); do
                 c++*) isCxx=1 ;;
             esac
             ;;
-        # check common c++ file extensions
-        # taken from clang: https://github.com/llvm/llvm-project/blob/4d6a5fc702e568b0456c4d8f9e2307eb6d81e955/clang/lib/Driver/Types.cpp#L299-L369
-        *.C|*.H|*.cc|*.CC|*.cp|*.hh|*.ccm|*.cpp|*.CPP|*.c++|*.C++|*.cxx|*.CXX|*.hpp|*.hxx|*.c++m|*.cppm|*.cxxm) isCxx=1 ;;
         --) # Everything else is positional args!
             # See: https://github.com/llvm/llvm-project/commit/ed1d07282cc9d8e4c25d585e03e5c8a1b6f63a74
 
@@ -68,12 +65,6 @@ while (( "$n" < "$nParams" )); do
 
             positionalArgs=("${params[@]:$n}")
             params=("${params[@]:0:$((n - 1))}")
-
-            for pa in "${positionalArgs[@]}"; do
-                case $pa in
-                    *.C|*.H|*.cc|*.CC|*.cp|*.hh|*.ccm|*.cpp|*.CPP|*.c++|*.C++|*.cxx|*.CXX|*.hpp|*.hxx|*.c++m|*.cppm|*.cxxm) isCxx=1 ;;
-                esac
-            done
             break;
             ;;
         -?*) ;;