diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/features.h | 14 | ||||
-rw-r--r-- | include/libc-symbols.h | 27 | ||||
-rw-r--r-- | include/libintl.h | 16 |
3 files changed, 30 insertions, 27 deletions
diff --git a/include/features.h b/include/features.h index bc10510415..de2b143b60 100644 --- a/include/features.h +++ b/include/features.h @@ -244,9 +244,23 @@ #define __GLIBC__ 2 #define __GLIBC_MINOR__ 2 +/* Convenience macros to test the versions of glibc and gcc. + Use them like this: + #if __GNUC_PREREQ (2,8) + ... code requiring gcc 2.8 or later ... + #endif + Note - they won't work for gcc1 or glibc1, since the _MINOR macros + were not defined then. */ +#define __GNUC_PREREQ(maj,min) (defined __GNUC__ && defined __GNUC_MINOR__ \ + && ((__GNUC__ << 16) + __GNUC_MINOR__) >= ((maj<<16) + min)) +#define __GLIBC_PREREQ(maj,min) (defined __GLIBC__ && defined __GLIBC_MINOR__ \ + && ((__GLIBC__ << 16) + __GLIBC_MINOR__) >= ((maj<<16) + min)) + /* This is here only because every header file already includes this one. */ #ifndef __ASSEMBLER__ +#ifndef _SYS_CDEFS_H # include <sys/cdefs.h> +#endif /* If we don't have __REDIRECT, prototypes will be missing if __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 5d15791fda..dd573b32a8 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -52,34 +52,7 @@ #define _REENTRANT 1 #include <config.h> -/* - -*/ - -#ifndef __ASSEMBLER__ -/* Define the macros `_' and `N_' for conveniently marking translatable - strings in the libc source code. */ - -# define N_(msgid) msgid - -# include <libintl.h> -extern const char _libc_intl_domainname[]; - -# ifdef dgettext -/* This is defined as an optimizing macro, so use it. */ -# define _(msgid) dgettext (_libc_intl_domainname, (msgid)) -# else -/* Be sure to use only the __ name when `dgettext' is a plain function - instead of an optimizing macro. */ -# define _(msgid) __dgettext (_libc_intl_domainname, (msgid)) -# endif - -#endif - -/* - -*/ /* The symbols in all the user (non-_) macros are C symbols. HAVE_GNU_LD without HAVE_ELF implies a.out. */ diff --git a/include/libintl.h b/include/libintl.h index 3763b04c5f..a772853c02 100644 --- a/include/libintl.h +++ b/include/libintl.h @@ -6,4 +6,20 @@ extern char *__gettext __P ((__const char *__msgid)); extern char *__textdomain __P ((__const char *__domainname)); extern char *__bindtextdomain __P ((__const char *__domainname, __const char *__dirname)); +extern const char _libc_intl_domainname[]; + +/* Define the macros `_' and `N_' for conveniently marking translatable + strings in the libc source code. */ + +# define N_(msgid) msgid + +# ifdef dgettext +/* This is defined as an optimizing macro, so use it. */ +# define _(msgid) dgettext (_libc_intl_domainname, (msgid)) +# else +/* Be sure to use only the __ name when `dgettext' is a plain function + instead of an optimizing macro. */ +# define _(msgid) __dgettext (_libc_intl_domainname, (msgid)) +# endif + #endif |