Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* configure.in (libc_cv_gnu89_inline): Test for -fgnu89-inline.
	* config.make.in (gnu89-inline-CFLAGS): New variable.
	* Makeconfig (CFLAGS): Use $(gnu89-inline-CFLAGS) together with
	-std=gnu99.
	* misc/sys/cdefs.h (__extern_inline, __extern_always_inline): Define.
	* argp/argp.h: Use it.
	* bits/mathinline.h: Likewise.
	* bits/sigset.h: Likewise.
	* bits/string.h: Likewise.
	* ctype/ctype.h: Likewise.
	* hurd/hurd.h: Likewise.
	* hurd/hurd/fd.h: Likewise.
	* hurd/hurd/port.h: Likewise.
	* hurd/hurd/signal.h: Likewise.
	* hurd/hurd/threadvar.h: Likewise.
	* hurd/hurd/userlink.h: Likewise.
	* io/sys/stat.h: Likewise.
	* libio/bits/stdio.h: Likewise.
	* libio/bits/stdio2.h: Likewise.
	* mach/lock-intern.h: Likewise.
	* mach/mach/mig_support.h: Likewise.
	* math/bits/cmathcalls.h: Likewise.
	* posix/bits/unistd.h: Likewise.
	* socket/bits/socket2.h: Likewise.
	* stdlib/bits/stdlib.h: Likewise.
	* stdlib/stdlib.h: Likewise.
	* string/argz.h: Likewise.
	* string/bits/string2.h: Likewise.
	* string/bits/string3.h: Likewise.
	* sysdeps/alpha/fpu/bits/mathinline.h: Likewise.
	* sysdeps/generic/inttypes.h: Likewise.
	* sysdeps/generic/machine-lock.h: Likewise.
	* sysdeps/generic/machine-sp.h: Likewise.
	* sysdeps/i386/fpu/bits/mathinline.h: Likewise.
	* sysdeps/i386/i486/bits/string.h: Likewise.
	* sysdeps/ia64/fpu/bits/mathinline.h: Likewise.
	* sysdeps/mach/alpha/machine-lock.h: Likewise.
	* sysdeps/mach/alpha/machine-sp.h: Likewise.
	* sysdeps/mach/i386/machine-lock.h: Likewise.
	* sysdeps/mach/powerpc/machine-lock.h: Likewise.
	* sysdeps/mach/powerpc/machine-sp.h: Likewise.
	* sysdeps/powerpc/fpu/bits/mathinline.h: Likewise.
	* sysdeps/s390/bits/string.h: Likewise.
	* sysdeps/s390/fpu/bits/mathinline.h: Likewise.
	* sysdeps/sparc/fpu/bits/mathinline.h: Likewise.
	* sysdeps/unix/bsd/bsd4.4/bits/socket.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/sigset.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/socket.h: Likewise.
	* sysdeps/unix/sysv/linux/sys/sysmacros.h: Likewise.
	* sysdeps/x86_64/fpu/bits/mathinline.h: Likewise.
	* wcsmbs/bits/wchar2.h: Likewise.
	* wcsmbs/wchar.h: Likewise.
	* stdlib/gmp.h: Likewise.  Include <features.h> to get
	__extern_inline definition.

	* locale/programs/ld-ctype.c (find_translit): Return NULL if ctype is
	NULL.
  • Loading branch information
Ulrich Drepper committed Mar 17, 2007
1 parent 63375de commit b037a29
Show file tree
Hide file tree
Showing 56 changed files with 293 additions and 183 deletions.
60 changes: 60 additions & 0 deletions ChangeLog
@@ -1,5 +1,65 @@
2007-03-16 Jakub Jelinek <jakub@redhat.com>

* configure.in (libc_cv_gnu89_inline): Test for -fgnu89-inline.
* config.make.in (gnu89-inline-CFLAGS): New variable.
* Makeconfig (CFLAGS): Use $(gnu89-inline-CFLAGS) together with
-std=gnu99.
* misc/sys/cdefs.h (__extern_inline, __extern_always_inline): Define.
* argp/argp.h: Use it.
* bits/mathinline.h: Likewise.
* bits/sigset.h: Likewise.
* bits/string.h: Likewise.
* ctype/ctype.h: Likewise.
* hurd/hurd.h: Likewise.
* hurd/hurd/fd.h: Likewise.
* hurd/hurd/port.h: Likewise.
* hurd/hurd/signal.h: Likewise.
* hurd/hurd/threadvar.h: Likewise.
* hurd/hurd/userlink.h: Likewise.
* io/sys/stat.h: Likewise.
* libio/bits/stdio.h: Likewise.
* libio/bits/stdio2.h: Likewise.
* mach/lock-intern.h: Likewise.
* mach/mach/mig_support.h: Likewise.
* math/bits/cmathcalls.h: Likewise.
* posix/bits/unistd.h: Likewise.
* socket/bits/socket2.h: Likewise.
* stdlib/bits/stdlib.h: Likewise.
* stdlib/stdlib.h: Likewise.
* string/argz.h: Likewise.
* string/bits/string2.h: Likewise.
* string/bits/string3.h: Likewise.
* sysdeps/alpha/fpu/bits/mathinline.h: Likewise.
* sysdeps/generic/inttypes.h: Likewise.
* sysdeps/generic/machine-lock.h: Likewise.
* sysdeps/generic/machine-sp.h: Likewise.
* sysdeps/i386/fpu/bits/mathinline.h: Likewise.
* sysdeps/i386/i486/bits/string.h: Likewise.
* sysdeps/ia64/fpu/bits/mathinline.h: Likewise.
* sysdeps/mach/alpha/machine-lock.h: Likewise.
* sysdeps/mach/alpha/machine-sp.h: Likewise.
* sysdeps/mach/i386/machine-lock.h: Likewise.
* sysdeps/mach/powerpc/machine-lock.h: Likewise.
* sysdeps/mach/powerpc/machine-sp.h: Likewise.
* sysdeps/powerpc/fpu/bits/mathinline.h: Likewise.
* sysdeps/s390/bits/string.h: Likewise.
* sysdeps/s390/fpu/bits/mathinline.h: Likewise.
* sysdeps/sparc/fpu/bits/mathinline.h: Likewise.
* sysdeps/unix/bsd/bsd4.4/bits/socket.h: Likewise.
* sysdeps/unix/sysv/linux/bits/sigset.h: Likewise.
* sysdeps/unix/sysv/linux/bits/socket.h: Likewise.
* sysdeps/unix/sysv/linux/sys/sysmacros.h: Likewise.
* sysdeps/x86_64/fpu/bits/mathinline.h: Likewise.
* wcsmbs/bits/wchar2.h: Likewise.
* wcsmbs/wchar.h: Likewise.
* stdlib/gmp.h: Likewise. Include <features.h> to get
__extern_inline definition.

2007-03-15 Jakub Jelinek <jakub@redhat.com>

* locale/programs/ld-ctype.c (find_translit): Return NULL if ctype is
NULL.

[BZ #3919]
* math/libm-test.inc (log_test): Test -Inf and NaN.
(log10_test, log1p_test, log2_test): Test -Inf.
Expand Down
4 changes: 2 additions & 2 deletions Makeconfig
@@ -1,4 +1,4 @@
# Copyright (C) 1991-2003,2004,2005,2006 Free Software Foundation, Inc.
# Copyright (C) 1991-2003,2004,2005,2006,2007 Free Software Foundation, Inc.
# This file is part of the GNU C Library.

# The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -672,7 +672,7 @@ CPPFLAGS = $($(subdir)-CPPFLAGS) $(+includes) $(defines) \
$(foreach lib,$(libof-$(basename $(@F))) \
$(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
$(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
override CFLAGS = -std=gnu99 \
override CFLAGS = -std=gnu99 $(gnu89-inline-CFLAGS) \
$(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
$(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
$(CFLAGS-$(@F))
Expand Down
5 changes: 3 additions & 2 deletions argp/argp.h
@@ -1,5 +1,6 @@
/* Hierarchial argument parsing, layered over getopt.
Copyright (C) 1995-1999,2003,2004,2005,2006 Free Software Foundation, Inc.
Copyright (C) 1995-1999, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
Expand Down Expand Up @@ -558,7 +559,7 @@ extern void *__argp_input (__const struct argp *__restrict __argp,
# endif

# ifndef ARGP_EI
# define ARGP_EI extern __inline__
# define ARGP_EI __extern_inline
# endif

ARGP_EI void
Expand Down
2 changes: 1 addition & 1 deletion bits/mathinline.h
@@ -1,6 +1,6 @@
/* This file should provide inline versions of math functions.
Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
This file should define __MATH_INLINES if functions are actually defined as
inlines. */
Expand Down
5 changes: 3 additions & 2 deletions bits/sigset.h
@@ -1,5 +1,6 @@
/* __sig_atomic_t, __sigset_t, and related definitions. Generic/BSD version.
Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1991, 1992, 1994, 1996, 1997, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -38,7 +39,7 @@ typedef unsigned long int __sigset_t;
#define _SIGSET_H_fns 1

#ifndef _EXTERN_INLINE
# define _EXTERN_INLINE extern __inline
# define _EXTERN_INLINE __extern_inline
#endif

/* Return a mask that includes SIG only. The cast to `sigset_t' avoids
Expand Down
2 changes: 1 addition & 1 deletion bits/string.h
@@ -1,6 +1,6 @@
/* This file should provide inline versions of string functions.
Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
This file should define __STRING_INLINES if functions are actually defined
as inlines. */
Expand Down
1 change: 1 addition & 0 deletions config.make.in
Expand Up @@ -53,6 +53,7 @@ have-cpp-asm-debuginfo = @libc_cv_cpp_asm_debuginfo@
enable-check-abi = @enable_check_abi@
have-forced-unwind = @libc_cv_forced_unwind@
have-fpie = @libc_cv_fpie@
gnu89-inline-CFLAGS = @libc_cv_gnu89_inline@
have-ssp = @libc_cv_ssp@
have-selinux = @have_selinux@
have-libaudit = @have_libaudit@
Expand Down
24 changes: 24 additions & 0 deletions configure.in
Expand Up @@ -1641,6 +1641,30 @@ fi
rm -f conftest*])
AC_SUBST(libc_cv_ssp)

AC_CACHE_CHECK(for -fgnu89-inline, libc_cv_gnu89_inline, [dnl
cat > conftest.c <<EOF
int foo;
#ifdef __GNUC_GNU_INLINE__
main () { return 0;}
#else
#error
#endif
EOF
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -std=gnu99 -fgnu89-inline
-o conftest conftest.c 1>&AS_MESSAGE_LOG_FD])
then
libc_cv_gnu89_inline=yes
else
libc_cv_gnu89_inline=no
fi
rm -f conftest*])
if test $libc_cv_gnu89_inline = yes; then
libc_cv_gnu89_inline=-fgnu89-inline
else
libc_cv_gnu89_inline=
fi
AC_SUBST(libc_cv_gnu89_inline)

if test $elf != yes; then
AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
[AC_TRY_COMPILE(, [asm (".section .init");
Expand Down
6 changes: 3 additions & 3 deletions ctype/ctype.h
@@ -1,4 +1,4 @@
/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,2002,2004
/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,2002,2004,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Expand Down Expand Up @@ -187,13 +187,13 @@ __exctype (_tolower);
# endif

# ifdef __USE_EXTERN_INLINES
extern __inline int
__extern_inline int
__NTH (tolower (int __c))
{
return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c;
}

extern __inline int
__extern_inline int
__NTH (toupper (int __c))
{
return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c;
Expand Down
5 changes: 3 additions & 2 deletions hurd/hurd.h
@@ -1,4 +1,5 @@
/* Copyright (C) 1993,94,95,96,97,98,99,2001,02 Free Software Foundation, Inc.
/* Copyright (C) 1993,94,95,96,97,98,99,2001,2002,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -44,7 +45,7 @@
#include <errno.h>

#ifndef _HURD_H_EXTERN_INLINE
#define _HURD_H_EXTERN_INLINE extern __inline
#define _HURD_H_EXTERN_INLINE __extern_inline
#endif

_HURD_H_EXTERN_INLINE int
Expand Down
4 changes: 2 additions & 2 deletions hurd/hurd/fd.h
@@ -1,5 +1,5 @@
/* File descriptors.
Copyright (C) 1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006
Copyright (C) 1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Expand Down Expand Up @@ -52,7 +52,7 @@ extern struct mutex _hurd_dtable_lock; /* Locks those two variables. */
#include <hurd/signal.h>

#ifndef _HURD_FD_H_EXTERN_INLINE
#define _HURD_FD_H_EXTERN_INLINE extern __inline
#define _HURD_FD_H_EXTERN_INLINE __extern_inline
#endif

/* Returns the descriptor cell for FD. If FD is invalid or unused, return
Expand Down
5 changes: 3 additions & 2 deletions hurd/hurd/port.h
@@ -1,5 +1,6 @@
/* Lightweight user references for ports.
Copyright (C) 1993, 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
Copyright (C) 1993, 1994, 1995, 1997, 1999, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -55,7 +56,7 @@ struct hurd_port


#ifndef _HURD_PORT_H_EXTERN_INLINE
#define _HURD_PORT_H_EXTERN_INLINE extern __inline
#define _HURD_PORT_H_EXTERN_INLINE __extern_inline
#endif


Expand Down
4 changes: 2 additions & 2 deletions hurd/hurd/signal.h
@@ -1,5 +1,5 @@
/* Implementing POSIX.1 signals under the Hurd.
Copyright (C) 1993,94,95,96,98,99,2002 Free Software Foundation, Inc.
Copyright (C) 1993,94,95,96,98,99,2002,2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -126,7 +126,7 @@ extern struct hurd_sigstate *_hurd_self_sigstate (void)
__attribute__ ((__const__));

#ifndef _HURD_SIGNAL_H_EXTERN_INLINE
#define _HURD_SIGNAL_H_EXTERN_INLINE extern __inline
#define _HURD_SIGNAL_H_EXTERN_INLINE __extern_inline
#endif

_HURD_SIGNAL_H_EXTERN_INLINE struct hurd_sigstate *
Expand Down
4 changes: 2 additions & 2 deletions hurd/hurd/threadvar.h
@@ -1,5 +1,5 @@
/* Internal per-thread variables for the Hurd.
Copyright (C) 1994,95,97,98,99,2001,02 Free Software Foundation, Inc.
Copyright (C) 1994,95,97,98,99,2001,02,06,07 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -74,7 +74,7 @@ enum __hurd_threadvar_index


#ifndef _HURD_THREADVAR_H_EXTERN_INLINE
#define _HURD_THREADVAR_H_EXTERN_INLINE extern __inline
#define _HURD_THREADVAR_H_EXTERN_INLINE __extern_inline
#endif

/* Return the location of the value for the per-thread variable with index
Expand Down
4 changes: 2 additions & 2 deletions hurd/hurd/userlink.h
@@ -1,5 +1,5 @@
/* Support for chains recording users of a resource; `struct hurd_userlink'.
Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
Copyright (C) 1994, 1995, 1997, 1999, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -71,7 +71,7 @@ struct hurd_userlink


#ifndef _HURD_USERLINK_H_EXTERN_INLINE
#define _HURD_USERLINK_H_EXTERN_INLINE extern __inline
#define _HURD_USERLINK_H_EXTERN_INLINE __extern_inline
#endif


Expand Down
23 changes: 12 additions & 11 deletions io/sys/stat.h
@@ -1,4 +1,5 @@
/* Copyright (C) 1991,1992,1995-2004,2005,2006 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1995-2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -430,28 +431,28 @@ extern int __xmknodat (int __ver, int __fd, __const char *__path,
#if defined __GNUC__ && __GNUC__ >= 2
/* Inlined versions of the real stat and mknod functions. */

extern __inline__ int
__extern_inline int
__NTH (stat (__const char *__path, struct stat *__statbuf))
{
return __xstat (_STAT_VER, __path, __statbuf);
}

# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
extern __inline__ int
__extern_inline int
__NTH (lstat (__const char *__path, struct stat *__statbuf))
{
return __lxstat (_STAT_VER, __path, __statbuf);
}
# endif

extern __inline__ int
__extern_inline int
__NTH (fstat (int __fd, struct stat *__statbuf))
{
return __fxstat (_STAT_VER, __fd, __statbuf);
}

# ifdef __USE_ATFILE
extern __inline__ int
__extern_inline int
__NTH (fstatat (int __fd, __const char *__filename, struct stat *__statbuf,
int __flag))
{
Expand All @@ -460,15 +461,15 @@ __NTH (fstatat (int __fd, __const char *__filename, struct stat *__statbuf,
# endif

# if defined __USE_MISC || defined __USE_BSD
extern __inline__ int
__extern_inline int
__NTH (mknod (__const char *__path, __mode_t __mode, __dev_t __dev))
{
return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
}
# endif

# ifdef __USE_ATFILE
extern __inline__ int
__extern_inline int
__NTH (mknodat (int __fd, __const char *__path, __mode_t __mode,
__dev_t __dev))
{
Expand All @@ -479,28 +480,28 @@ __NTH (mknodat (int __fd, __const char *__path, __mode_t __mode,
# if defined __USE_LARGEFILE64 \
&& (! defined __USE_FILE_OFFSET64 \
|| (defined __REDIRECT_NTH && defined __OPTIMIZE__))
extern __inline__ int
__extern_inline int
__NTH (stat64 (__const char *__path, struct stat64 *__statbuf))
{
return __xstat64 (_STAT_VER, __path, __statbuf);
}

# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
extern __inline__ int
__extern_inline int
__NTH (lstat64 (__const char *__path, struct stat64 *__statbuf))
{
return __lxstat64 (_STAT_VER, __path, __statbuf);
}
# endif

extern __inline__ int
__extern_inline int
__NTH (fstat64 (int __fd, struct stat64 *__statbuf))
{
return __fxstat64 (_STAT_VER, __fd, __statbuf);
}

# ifdef __USE_GNU
extern __inline__ int
__extern_inline int
__NTH (fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf,
int __flag))
{
Expand Down
4 changes: 2 additions & 2 deletions libio/bits/stdio.h
@@ -1,5 +1,5 @@
/* Optimizing macros and inline functions for stdio functions.
Copyright (C) 1998, 2000, 2001, 2004 Free Software Foundation, Inc.
Copyright (C) 1998, 2000, 2001, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand All @@ -24,7 +24,7 @@
#ifdef __cplusplus
# define __STDIO_INLINE inline
#else
# define __STDIO_INLINE extern __inline
# define __STDIO_INLINE __extern_inline
#endif


Expand Down

0 comments on commit b037a29

Please sign in to comment.