Re: header file substitutes

2024-05-05 Thread Bruno Haible
Hi Collin, > IIRC in there is: > > #define __STDC_ENDIAN_LITTLE__ /* Unique constant */ > #define __STDC_ENDIAN_BIG__ /* Unique constant */ > #define __STDC_ENDIAN_NATIVE__ /* __STDC_ENDIAN_LITTLE__ or > __STDC_ENDIAN_BIG__ */ You can work on this, once Paul has created an

Re: header file substitutes

2024-05-05 Thread Collin Funk
On 5/4/24 11:07 PM, Paul Eggert wrote: >> Since seems resonably portable, > > I assume you mean ? There's no on my Ubuntu system. No, sorry maybe I worded my original email awkwardly. :) I think all of the BSDs have which define: #define LITTLE_ENDIAN 1234 #define BIG_ENDIAN 4321

Re: header file substitutes

2024-05-05 Thread Paul Eggert
On 2024-05-04 15:33, Collin Funk wrote: But I don't think C23 has the conversion macros: /* big endian 32 to host. */ uint32_t be32toh (uint32_t); /* little endian 32 to host. */ uint32_t le32toh (uint32_t); Yes, those might be a good reason for a Gnulib endian module,

Re: header file substitutes

2024-05-04 Thread Collin Funk
On 5/4/24 2:30 PM, Paul Eggert wrote: >> But, I think the next POSIX revision has like Glibc which I >> prefer. > > If the past is any guide, an advantage of the C23 version is that in > the long run it is likely to be more portable. POSIX is an extension > of C. True. But I don't think C23 has

Re: header file substitutes

2024-05-04 Thread Paul Eggert
On 2024-05-04 13:54, Collin Funk wrote: IIRC in there is: #define __STDC_ENDIAN_LITTLE__ /* Unique constant */ #define __STDC_ENDIAN_BIG__ /* Unique constant */ #define __STDC_ENDIAN_NATIVE__ /* __STDC_ENDIAN_LITTLE__ or __STDC_ENDIAN_BIG__ */ probably with values taken

Re: header file substitutes

2024-05-04 Thread Collin Funk
Hi Bruno, On 5/4/24 7:52 AM, Bruno Haible wrote: > And we're not yet done with the header file substitutes. One is still missing > from Gnulib: [1]. The only thing that has changed since last year > is that glibc 2.39 now has this header file [2]. But who will want to use it, > as

Re: header file substitutes

2024-05-04 Thread Paul Eggert
On 2024-05-04 07:52, Bruno Haible wrote: But who will want to use it, as long as it's not portable? I'm working on a Gnulib that will work on pre-C23 platforms. Eventually this should replace Gnulib's count-leading-zeros, count-trailing-zeros, and count-one-bits modules, which should be

Re: header file substitutes

2024-05-04 Thread Bruno Haible
Collin Funk wrote: > I didn't realize the header replacements started this early. I'm a big > fan of them. And we're not yet done with the header file substitutes. One is still missing from Gnulib: [1]. The only thing that has changed since last year is that glibc 2.39 now has this heade