From 264b817b8eb1bf626ade1db6c200f2fa91358331 Mon Sep 17 00:00:00 2001 From: Pieter du Preez Date: Sun, 14 Feb 2016 11:12:06 +0100 Subject: Define the newlib version macros in one place: _newlib_version.h. Currently, the newlib version information needs to be updated in two places: - newlib/acinclude.m4 - newlib/libc/include/sys/features.h The goal of this patch is to: - supply a single location for defining the newlib version information: newlib/acinclude.m4 - define __NEWLIB__, __NEWLIB_MINOR__ and __NEWLIB_PATCHLEVEL__ This is in line with what gcc does for its version macros. See: https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html This patch moves the definition of the _NEWLIB_VERSION, __NEWLIB__ and __NEWLIB_MINOR__ macros from newlib/libc/include/sys/features.h, to the newly generated newlib/_newlib_version.h file. Additionally, the __NEWLIB_PATCHLEVEL__ macro was created, for completeness. In order to stay backwards compatible, newlib/_newlib_version.h gets included by newlib/newlib.h and newlib/libc/include/sys/features.h. Note: This patch does _not_ include the modifications to the following files, as these should all be generated any way. *Makefile.in, *aclocal.m4, *configure stamp-* files Signed-off-by: Pieter du Preez --- newlib/libc/include/sys/features.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'newlib/libc/include') diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h index 0c6043cf9..e3168beaa 100644 --- a/newlib/libc/include/sys/features.h +++ b/newlib/libc/include/sys/features.h @@ -25,11 +25,7 @@ extern "C" { #endif -/* Macros to determine that newlib is being used. Put in this header to - * be similar to where glibc stores its version of these macros. - */ -#define __NEWLIB__ 2 -#define __NEWLIB_MINOR__ 2 +#include <_newlib_version.h> /* Macro to test version of GCC. Returns 0 for non-GCC or too old GCC. */ #ifndef __GNUC_PREREQ -- cgit v1.2.3