This is the mail archive of the
mailing list for the newlib project.
Re: [PATCH] Automated the generation of the __NEWLIB__, __NEWLIB_MINOR__ and __NEWLIB_PATCHLEVEL__ macros.
- From: Pieter du Preez <pdupreez at gmail dot com>
- To: newlib at sourceware dot org
- Date: Fri, 29 Jan 2016 23:05:15 +0100
- Subject: Re: [PATCH] Automated the generation of the __NEWLIB__, __NEWLIB_MINOR__ and __NEWLIB_PATCHLEVEL__ macros.
- Authentication-results: sourceware.org; auth=none
- References: <20160125201938 dot GA19917 at bling> <20160128103806 dot GD10851 at calimero dot vinschen dot de> <2044933968 dot 16515818 dot 1453987626889 dot JavaMail dot zimbra at redhat dot com> <20160129142013 dot GA28886 at bling> <1805653431 dot 17249188 dot 1454080285047 dot JavaMail dot zimbra at redhat dot com>
On Fri, Jan 29, 2016 at 10:11:25AM -0500, Jeff Johnston wrote:
> This idea could be modified to do something like glibc does for bringing in particular macros
> from a header file (e.g. __need_size_t to bring in just size_t from stddef.h). Thus, you
> set __need_version_macros and include newlib.h in <sys/features.h> and modify newlib.h.in
> accordingly. This restores the current behaviour. What do you think?
Thanks Jeff. So, if I understand you correctly, we should do the
#define __need_newlib_version_macros 1
In the generated newlib.h:
#define __NEWLIB__ 2
#define __NEWLIB_MINOR__ 2
#define __NEWLIB_PATCHLEVEL__ 0
This however means that <sys/features.h> will now get all the rest of
the defines in newlib.h as well. Would this harm? To work around this
cleanly, one would have to do this __need_newlib_<def_group> trick for
all currently generated #defines in newlib.h.
I can offer one of the either A or B:
A: The following two patches:
1. A __need_newlib_<def_group> trick for all generated #defines in newlib.h
2. Move definition of the newlib version macros to newlib.h
B: Just a simple patch, as you suggested, but with the downside that
<sys/features.h> will get all the rest of the generated #defines in
newlib.h as well.
What would you suggest?