Abstract and cleanup ugly byte swapping code

These macros don't assume alignment and may be somewhat inefficient with
all that copying. I'm hoping GCC is able to optimize that crap somewhat.

Also the pg type receive functions can not, in fact, assume that their
input buffers are properly aligned. That won't necessarily be the case
for array elements.
This commit is contained in:
Yorhel 2025-02-10 07:34:08 +01:00
parent 7d71e446d0
commit d5f593387a
4 changed files with 55 additions and 77 deletions

View file

@ -3,7 +3,6 @@ use Config;
os_unsupported if $^O eq 'MSWin32'; # I don't know on which OS'es the code will work exactly, but this one I can easily rule out.
os_unsupported if $Config{ivsize} < 8;
os_unsupported if $Config{byteorder} != 12345678; # pgtypes.c assumes we're little-endian
os_unsupported if $Config{usequadmath};
WriteMakefile(