$NetBSD: patch-src_3rdparty_chromium_third__party_blink_renderer_build_scripts_gperf.py,v 1.1 2026/04/30 06:39:43 adam Exp $

* Part of patchset to build chromium on NetBSD
* Based on OpenBSD's chromium patches, and
  pkgsrc's qt5-qtwebengine patches

--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py.orig	2026-03-16 11:40:07.000000000 +0000
+++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py
@@ -28,27 +28,6 @@ def generate_gperf(gperf_path, gperf_inp
             stdout=subprocess.PIPE,
             universal_newlines=True)
         gperf_output = gperf.communicate(gperf_input)[0]
-        # Massage gperf output to be more palatable for modern compilers.
-        # TODO(thakis): Upstream these to gperf so we don't need massaging.
-        # `register` is deprecated in C++11 and removed in C++17, so remove
-        # it from gperf's output.
-        # https://savannah.gnu.org/bugs/index.php?53028
-        gperf_output = re.sub(r'\bregister ', '', gperf_output)
-        # -Wimplicit-fallthrough needs an explicit fallthrough statement,
-        # so replace gperf 3.1's /*FALLTHROUGH*/ comment with the statement.
-        # https://savannah.gnu.org/bugs/index.php?53029 (fixed in 3.2)
-        if re.search(
-                r'/\* C\+\+ code produced by gperf version 3\.[01](\.\d+)? \*/',
-                gperf_output):
-            gperf_output = gperf_output.replace('/*FALLTHROUGH*/',
-                                                '  [[fallthrough]];')
-        # -Wpointer-to-int-cast warns about casting pointers to smaller ints
-        # Replace {(int)(long)&(foo), bar} with
-        # {static_cast<int>(reinterpret_cast<uintptr_t>(&(foo)), bar}
-        gperf_output = re.sub(
-            r'\(int\)\(long\)(.*?),',
-            r'static_cast<int>(reinterpret_cast<uintptr_t>(\1)),',
-            gperf_output)
         script = 'third_party/blink/renderer/build/scripts/gperf.py'
         return '// Generated by %s\n' % script + gperf_output
     except OSError:
