On 08 Nov 2021 16:05, Corinna Vinschen wrote: > On Nov 8 06:46, Mike Frysinger wrote: > > On 08 Nov 2021 11:05, Corinna Vinschen wrote: > > > On Nov 6 20:21, Mike Frysinger wrote: > > > > i stumbled across _COMPILING_NEWLIB and it seems to be what i want: a symbol > > > > that indicates the code currently being compiled is newlib itself so that the > > > > header can change behavior for that environment specifically. is that what > > > > it's meant for ? > > > > > > > > if so, why does it seem to be inconsistently defined ? newlib/configure.host > > > > will add it for a few random targets, as does the mips-specific > > > > newlib/libc/machine/mips/Makefile.am, as do a few specific winsup/cygwin/ > > > > files. it feels like the patch below is what we should have. > > > > > > > > if that's not what this is for, is there a define that has this meaning ? > > > > in the glibc & gnulib world, the plain _LIBC define indicates this. > > > > > > _COMPILING_NEWLIB might be older than that. In Cygwin we certainly need > > > it during build. Your patch looks good to me, did you test it for some > > > targets? > > > > yes, i tested it for bfin-elf and with a change that needed it in ctype.h. > > the ctype.h change didn't work until i updated the build this way. > > uhm... why does a change in a header file depend on the build system? > That sounds weird. i'm making a fix to ctype.h that would utilize _COMPILING_NEWLIB as part of its fix. i was holding off posting that until the question of this symbol could be sorted out. > I tested building on Cygwin, which looks good. > > So, here's a question: The patch is ok, just a change to the commit > message would be nice. However, would you like to take the opportunity > to change _COMPILING_NEWLIB to _LIBC throughout? That's something we > should have done long ago, I guess. let me do it as a series. _LIBC is already used in newlib, so i'm afraid it might not be as clean as just renaming the define. but i'll give it a shot and see what blows up. -mike