Re: Hide exposed impl detail of wchar.c

Eric Ridge <eebbrr@gmail.com>

From: Eric Ridge <eebbrr@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Jubilee Young <workingjubilee@gmail.com>, Nathan Bossart <nathandbossart@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2023-11-21T15:14:32Z
Lists: pgsql-hackers
> On Nov 20, 2023, at 7:10 PM, Andres Freund <andres@anarazel.de> wrote:
> 
> 
> What I don't quite get is why SIMD headers are particularly more problematic
> than others - there's other headers that are compiler specific?

The short answer is the rust-based bindings generation tool pgrx uses (bindgen) is a little brain dead and gets confused when there’s multiple compiler builtins headers on the host.

This simd header is the first of its kind we’ve run across that’s exposed via Postgres’ “public api”. And bindgen wants to follow all the includes, it gets confused, picks the wrong one, and then errors happen.

And I don’t know that it makes much sense for Postgres to include such a header into 3rd-party code anyways. 

I think Jubilee is also working with them to fix this, but we’re hoping Jubilee’s patch here (or similar) can get merged so we can clear our build drama.

eric


Commits

  1. Move is_valid_ascii() to ascii.h.

  2. Use SSE2 in is_valid_ascii() where available.