From 4360eafdd20769fa9d42c075853271debd06f7d1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 19 Jun 1999 09:58:37 +0000 Subject: Update. 1999-06-18 Zack Weinberg * include/features.h: Define new macros __GNUC_PREREQ and __GLIBC_PREREQ which can be used to test the version of gcc and glibc respectively. * assert/assert.h: Use __GNUC_PREREQ. * intl/libintl.h: Likewise. * math/complex.h: Likewise. * math/tgmath.h: Likewise. * misc/sys/cdefs.h: Likewise. * posix/sys/types.h: Likewise. * socket/sys/socket.h: Likewise. * string/bits/string2.h: Likewise. * sysdeps/alpha/fpu/bits/mathinline.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.h: Likewise. 1999-06-18 Zack Weinberg * include/libintl.h: Declare _libc_intl_domainname here. Define _ and N_ here. * include/libc-symbols.h: Don't include . Don't define _ and N_. Don't declare _libc_intl_domainname. * Makeconfig (CPPFLAGS): Use -imacros to read libc-symbols.h. * db2/config.h: Don't include sys/stat.h or define HAVE_ST_BLKSIZE here... * db2/compat.h: ...do it here. * linuxthreads/internals.h: Include bits/libc-tsd.h after all other headers. * linuxthreads/no-tsd.c: Include sys/cdefs.h for __P. * iconv/iconv.c: Include stddef.h for NULL. * malloc/malloc.h: Include features.h. * sysdeps/generic/morecore.c: Use __malloc_ptr_t not __ptr_t. * sysdeps/unix/make_errlist.c: Write an "#include " into the generated file. * sysdeps/gnu/errlist.awk: Likewise. * sysdeps/gnu/errlist.c: Rebuilt. * assert/assert-perr.c: Include libintl.h. * assert/assert.c: Likewise. * elf/dl-open.c: Likewise. * elf/dlsym.c: Likewise. * elf/dlvsym.c: Likewise. * iconv/iconv_prog.c: Likewise. * inet/rcmd.c: Likewise. * inet/ruserpass.c: Likewise. * locale/programs/charset.c: Likewise. * locale/programs/ld-collate.c: Likewise. * locale/programs/ld-ctype.c: Likewise. * locale/programs/ld-messages.c: Likewise. * locale/programs/ld-monetary.c: Likewise. * locale/programs/ld-numeric.c: Likewise. * locale/programs/ld-time.c: Likewise. * locale/programs/locfile.c: Likewise. * locale/programs/repertoire.c: Likewise. * login/programs/database.c: Likewise. * login/programs/request.c: Likewise. * malloc/mcheck.c: Likewise. * misc/error.c: Likewise. * nis/nis_call.c: Likewise. * nis/nis_callback.c: Likewise. * nis/nis_error.c: Likewise. * nis/nis_local_names.c: Likewise. * nis/nis_print.c: Likewise. * nis/nis_print_group_entry.c: Likewise. * nis/ypclnt.c: Likewise. * nis/nss_nisplus/nisplus-publickey.c: Likewise. * nscd/cache.c: Likewise. * nscd/connections.c: Likewise. * nscd/grpcache.c: Likewise. * nscd/hstcache.c: Likewise. * nscd/nscd_conf.c: Likewise. * nscd/nscd_stat.c: Likewise. * nscd/pwdcache.c: Likewise. * posix/id.c: Likewise. * resolv/herror.c: Likewise. * stdio-common/psignal.c: Likewise. * string/strsignal.c: Likewise. * sunrpc/auth_unix.c: Likewise. * sunrpc/clnt_perr.c: Likewise. * sunrpc/clnt_raw.c: Likewise. * sunrpc/clnt_tcp.c: Likewise. * sunrpc/clnt_udp.c: Likewise. * sunrpc/clnt_unix.c: Likewise. * sunrpc/get_myaddr.c: Likewise. * sunrpc/pm_getmaps.c: Likewise. * sunrpc/pmap_clnt.c: Likewise. * sunrpc/pmap_rmt.c: Likewise. * sunrpc/rpc_main.c: Likewise. * sunrpc/rpc_scan.c: Likewise. * sunrpc/svc_run.c: Likewise. * sunrpc/svc_simple.c: Likewise. * sunrpc/svc_tcp.c: Likewise. * sunrpc/svc_udp.c: Likewise. * sunrpc/svc_unix.c: Likewise. * sunrpc/xdr_rec.c: Likewise. * sunrpc/xdr_ref.c: Likewise. * sysdeps/mach/hurd/mips/dl-machine.c: Likewise. * sysdeps/posix/gai_strerror.c: Likewise. * sysdeps/unix/siglist.c: Likewise. * sysdeps/unix/sysv/linux/siglist.c: Likewise. * sysdeps/unix/sysv/linux/arm/siglist.c: Likewise. * sysdeps/unix/sysv/sysv4/solaris2/sparc/errlist.c: Likewise. * timezone/zic.c: Likewise. --- include/features.h | 14 ++++++++++++++ include/libc-symbols.h | 27 --------------------------- include/libintl.h | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 27 deletions(-) (limited to 'include') 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 +#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 -/* - -*/ - -#ifndef __ASSEMBLER__ -/* Define the macros `_' and `N_' for conveniently marking translatable - strings in the libc source code. */ - -# define N_(msgid) msgid - -# include -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 -- cgit v1.2.3