On 18 Apr 2024, at 17:07, Yann Ylavic <ylavic....@gmail.com> wrote: > If so maybe: > > typedef struct > { > union { > char *str; > void *mem; > } d; > #if APR_SIZEOF_VOIDP == 8 > # define APR_BUFFER_SIZE_WIDTH 63 > #else > # define APR_BUFFER_SIZE_WIDTH 31 > #endif > apr_size_t size:APR_BUFFER_SIZE_WIDTH, > zero_terminated:1; > } apr_buffer_t; > > One could still use buf->size directly.
This is way simpler, thank you - I have made it so. http://svn.apache.org/viewvc?view=revision&revision=1917266 Regards, Graham --