Commit 0d667716 by Kaveh R. Ghazi Committed by Kaveh Ghazi

configure.ac (fixincludes_UNLOCKED_FUNCS): New.

fixincludes:
	* configure.ac (fixincludes_UNLOCKED_FUNCS): New.
	(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for fixincludes_UNLOCKED_FUNCS.
	* system.h (putchar, getc, getchar, clearerr, feof, fileno,
	fflush, fgetc, fgets, ferror, fread): Redefine to the associated
	_unlocked function.
	(fwrite_unlocked): Fix prototype.

	* configure, config.h.in: Regenerate.

gcc:
	PR/17092
	* configure.ac (gcc_UNLOCKED_FUNCS): New.
	(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for gcc_UNLOCKED_FUNCS.
	* system.h (putchar, getc, getchar, clearerr, feof, fileno,
	fflush, fgetc, fgets, ferror, fread): Redefine to the associated
	_unlocked function.
	(fwrite_unlocked): Fix prototype.

	* configure, config.in: Regenerate.

libcpp:
	* configure.ac (libcpp_UNLOCKED_FUNCS): New.
	(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
	* system.h (putchar, getc, getchar, clearerr, feof, fileno,
	fflush, fgetc, fgets, ferror, fread): Redefine to the associated
	_unlocked function.
	(fwrite_unlocked): Fix prototype.

	* configure, config.in: Regenerate.

From-SVN: r97986
parent 37cca405
2005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.ac (fixincludes_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for fixincludes_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.h.in: Regenerate.
2005-03-21 Zack Weinberg <zack@codesourcery.com>
* Makefile.in: Set gcc_version directly, not via substitution.
......
......@@ -3,14 +3,45 @@
/* Defined to the executable file extension on the host system */
#undef EXE_EXT
/* Define to 1 if you have the `clearerr_unlocked' function. */
#undef HAVE_CLEARERR_UNLOCKED
/* Define to 1 if you have the declaration of `abort', and to 0 if you don't.
*/
#undef HAVE_DECL_ABORT
/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_CLEARERR_UNLOCKED
/* Define to 1 if you have the declaration of `errno', and to 0 if you don't.
*/
#undef HAVE_DECL_ERRNO
/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_FEOF_UNLOCKED
/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FERROR_UNLOCKED
/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FFLUSH_UNLOCKED
/* Define to 1 if you have the declaration of `fgetc_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FGETC_UNLOCKED
/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FGETS_UNLOCKED
/* Define to 1 if you have the declaration of `fileno_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FILENO_UNLOCKED
/* Define to 1 if you have the declaration of `fprintf_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FPRINTF_UNLOCKED
......@@ -23,10 +54,26 @@
you don't. */
#undef HAVE_DECL_FPUTS_UNLOCKED
/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FREAD_UNLOCKED
/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FWRITE_UNLOCKED
/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_GETCHAR_UNLOCKED
/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_GETC_UNLOCKED
/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_PUTCHAR_UNLOCKED
/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_PUTC_UNLOCKED
......@@ -34,6 +81,24 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `feof_unlocked' function. */
#undef HAVE_FEOF_UNLOCKED
/* Define to 1 if you have the `ferror_unlocked' function. */
#undef HAVE_FERROR_UNLOCKED
/* Define to 1 if you have the `fflush_unlocked' function. */
#undef HAVE_FFLUSH_UNLOCKED
/* Define to 1 if you have the `fgetc_unlocked' function. */
#undef HAVE_FGETC_UNLOCKED
/* Define to 1 if you have the `fgets_unlocked' function. */
#undef HAVE_FGETS_UNLOCKED
/* Define to 1 if you have the `fileno_unlocked' function. */
#undef HAVE_FILENO_UNLOCKED
/* Define to 1 if you have the `fprintf_unlocked' function. */
#undef HAVE_FPRINTF_UNLOCKED
......@@ -43,9 +108,18 @@
/* Define to 1 if you have the `fputs_unlocked' function. */
#undef HAVE_FPUTS_UNLOCKED
/* Define to 1 if you have the `fread_unlocked' function. */
#undef HAVE_FREAD_UNLOCKED
/* Define to 1 if you have the `fwrite_unlocked' function. */
#undef HAVE_FWRITE_UNLOCKED
/* Define to 1 if you have the `getchar_unlocked' function. */
#undef HAVE_GETCHAR_UNLOCKED
/* Define to 1 if you have the `getc_unlocked' function. */
#undef HAVE_GETC_UNLOCKED
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
......@@ -61,6 +135,9 @@
/* Define if read-only mmap of a plain file works. */
#undef HAVE_MMAP_FILE
/* Define to 1 if you have the `putchar_unlocked' function. */
#undef HAVE_PUTCHAR_UNLOCKED
/* Define to 1 if you have the `putc_unlocked' function. */
#undef HAVE_PUTC_UNLOCKED
......
......@@ -66,10 +66,13 @@ AC_DEFINE_UNQUOTED([EXE_EXT], "$ac_exeext",
AC_HEADER_STDC
AC_CHECK_HEADERS([stddef.h stdlib.h strings.h unistd.h fcntl.h sys/file.h \
sys/stat.h])
AC_CHECK_FUNCS(putc_unlocked fputc_unlocked fputs_unlocked \
fwrite_unlocked fprintf_unlocked)
AC_CHECK_DECLS([abort, errno, putc_unlocked, fputc_unlocked,
fputs_unlocked, fwrite_unlocked, fprintf_unlocked])
define(fixincludes_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
putchar_unlocked putc_unlocked)
AC_CHECK_FUNCS(fixincludes_UNLOCKED_FUNCS)
AC_CHECK_DECLS(m4_split(m4_normalize(abort errno fixincludes_UNLOCKED_FUNCS)))
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
......
......@@ -57,11 +57,65 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# undef putc
# define putc(C, Stream) putc_unlocked (C, Stream)
# endif
# ifdef HAVE_PUTCHAR_UNLOCKED
# undef putchar
# define putchar(C) putchar_unlocked (C)
# endif
# ifdef HAVE_GETC_UNLOCKED
# undef getc
# define getc(Stream) getc_unlocked (Stream)
# endif
# ifdef HAVE_GETCHAR_UNLOCKED
# undef getchar
# define getchar() getchar_unlocked ()
# endif
# ifdef HAVE_FPUTC_UNLOCKED
# undef fputc
# define fputc(C, Stream) fputc_unlocked (C, Stream)
# endif
# ifdef HAVE_CLEARERR_UNLOCKED
# undef clearerr
# define clearerr(Stream) clearerr_unlocked (Stream)
# if defined (HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED
extern void clearerr_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FEOF_UNLOCKED
# undef feof
# define feof(Stream) feof_unlocked (Stream)
# if defined (HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED
extern int feof_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FILENO_UNLOCKED
# undef fileno
# define fileno(Stream) fileno_unlocked (Stream)
# if defined (HAVE_DECL_FILENO_UNLOCKED) && !HAVE_DECL_FILENO_UNLOCKED
extern int fileno_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FFLUSH_UNLOCKED
# undef fflush
# define fflush(Stream) fflush_unlocked (Stream)
# if defined (HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED
extern int fflush_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FGETC_UNLOCKED
# undef fgetc
# define fgetc(Stream) fgetc_unlocked (Stream)
# if defined (HAVE_DECL_FGETC_UNLOCKED) && !HAVE_DECL_FGETC_UNLOCKED
extern int fgetc_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FGETS_UNLOCKED
# undef fgets
# define fgets(S, n, Stream) fgets_unlocked (S, n, Stream)
# if defined (HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED
extern char *fgets_unlocked (char *, int, FILE *);
# endif
# endif
# ifdef HAVE_FPUTS_UNLOCKED
# undef fputs
# define fputs(String, Stream) fputs_unlocked (String, Stream)
......@@ -69,11 +123,25 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
extern int fputs_unlocked (const char *, FILE *);
# endif
# endif
# ifdef HAVE_FERROR_UNLOCKED
# undef ferror
# define ferror(Stream) ferror_unlocked (Stream)
# if defined (HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED
extern int ferror_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FREAD_UNLOCKED
# undef fread
# define fread(Ptr, Size, N, Stream) fread_unlocked (Ptr, Size, N, Stream)
# if defined (HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED
extern size_t fread_unlocked (void *, size_t, size_t, FILE *);
# endif
# endif
# ifdef HAVE_FWRITE_UNLOCKED
# undef fwrite
# define fwrite(Ptr, Size, N, Stream) fwrite_unlocked (Ptr, Size, N, Stream)
# if defined (HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
extern int fwrite_unlocked (const void *, size_t, size_t, FILE *);
extern size_t fwrite_unlocked (const void *, size_t, size_t, FILE *);
# endif
# endif
# ifdef HAVE_FPRINTF_UNLOCKED
......
2005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR/17092
* configure.ac (gcc_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for gcc_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.in: Regenerate.
2005-04-11 David Edelsohn <edelsohn@gnu.org>
* tree-ssa-loop-im.c: Include real.h.
......
......@@ -145,6 +145,9 @@
/* Define to 1 if you have the `atoq' function. */
#undef HAVE_ATOQ
/* Define to 1 if you have the `clearerr_unlocked' function. */
#undef HAVE_CLEARERR_UNLOCKED
/* Define to 1 if you have the `clock' function. */
#undef HAVE_CLOCK
......@@ -169,6 +172,10 @@
*/
#undef HAVE_DECL_CALLOC
/* Define to 1 if we found a declaration for 'clearerr_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_CLEARERR_UNLOCKED
/* Define to 1 if we found a declaration for 'clock', otherwise define to 0.
*/
#undef HAVE_DECL_CLOCK
......@@ -177,14 +184,46 @@
*/
#undef HAVE_DECL_ERRNO
/* Define to 1 if we found a declaration for 'feof_unlocked', otherwise define
to 0. */
#undef HAVE_DECL_FEOF_UNLOCKED
/* Define to 1 if we found a declaration for 'ferror_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_FERROR_UNLOCKED
/* Define to 1 if we found a declaration for 'fflush_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_FFLUSH_UNLOCKED
/* Define to 1 if we found a declaration for 'fgetc_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_FGETC_UNLOCKED
/* Define to 1 if we found a declaration for 'fgets_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_FGETS_UNLOCKED
/* Define to 1 if we found a declaration for 'fileno_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_FILENO_UNLOCKED
/* Define to 1 if we found a declaration for 'fprintf_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_FPRINTF_UNLOCKED
/* Define to 1 if we found a declaration for 'fputc_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_FPUTC_UNLOCKED
/* Define to 1 if we found a declaration for 'fputs_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_FPUTS_UNLOCKED
/* Define to 1 if we found a declaration for 'fread_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_FREAD_UNLOCKED
/* Define to 1 if we found a declaration for 'free', otherwise define to 0. */
#undef HAVE_DECL_FREE
......@@ -192,10 +231,18 @@
define to 0. */
#undef HAVE_DECL_FWRITE_UNLOCKED
/* Define to 1 if we found a declaration for 'getchar_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_GETCHAR_UNLOCKED
/* Define to 1 if we found a declaration for 'getcwd', otherwise define to 0.
*/
#undef HAVE_DECL_GETCWD
/* Define to 1 if we found a declaration for 'getc_unlocked', otherwise define
to 0. */
#undef HAVE_DECL_GETC_UNLOCKED
/* Define to 1 if we found a declaration for 'getenv', otherwise define to 0.
*/
#undef HAVE_DECL_GETENV
......@@ -228,6 +275,10 @@
*/
#undef HAVE_DECL_MALLOC
/* Define to 1 if we found a declaration for 'putchar_unlocked', otherwise
define to 0. */
#undef HAVE_DECL_PUTCHAR_UNLOCKED
/* Define to 1 if we found a declaration for 'putc_unlocked', otherwise define
to 0. */
#undef HAVE_DECL_PUTC_UNLOCKED
......@@ -272,6 +323,24 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `feof_unlocked' function. */
#undef HAVE_FEOF_UNLOCKED
/* Define to 1 if you have the `ferror_unlocked' function. */
#undef HAVE_FERROR_UNLOCKED
/* Define to 1 if you have the `fflush_unlocked' function. */
#undef HAVE_FFLUSH_UNLOCKED
/* Define to 1 if you have the `fgetc_unlocked' function. */
#undef HAVE_FGETC_UNLOCKED
/* Define to 1 if you have the `fgets_unlocked' function. */
#undef HAVE_FGETS_UNLOCKED
/* Define to 1 if you have the `fileno_unlocked' function. */
#undef HAVE_FILENO_UNLOCKED
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
......@@ -284,6 +353,9 @@
/* Define to 1 if you have the `fputs_unlocked' function. */
#undef HAVE_FPUTS_UNLOCKED
/* Define to 1 if you have the `fread_unlocked' function. */
#undef HAVE_FREAD_UNLOCKED
/* Define to 1 if you have the `fwrite_unlocked' function. */
#undef HAVE_FWRITE_UNLOCKED
......@@ -321,6 +393,12 @@
/* Define if your assembler supports .weak. */
#undef HAVE_GAS_WEAK
/* Define to 1 if you have the `getchar_unlocked' function. */
#undef HAVE_GETCHAR_UNLOCKED
/* Define to 1 if you have the `getc_unlocked' function. */
#undef HAVE_GETC_UNLOCKED
/* Define to 1 if you have the `getrlimit' function. */
#undef HAVE_GETRLIMIT
......@@ -421,6 +499,9 @@
/* Define if printf supports "%p". */
#undef HAVE_PRINTF_PTR
/* Define to 1 if you have the `putchar_unlocked' function. */
#undef HAVE_PUTCHAR_UNLOCKED
/* Define to 1 if you have the `putc_unlocked' function. */
#undef HAVE_PUTC_UNLOCKED
......
......@@ -9011,11 +9011,22 @@ fi
for ac_func in times clock dup2 kill getrlimit setrlimit atoll atoq \
sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \
fwrite_unlocked fprintf_unlocked getrusage nl_langinfo \
scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore \
setlocale
sysconf strsignal getrusage nl_langinfo scandir alphasort \
gettimeofday mbstowcs wcswidth mmap mincore setlocale \
clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
......@@ -11158,10 +11169,21 @@ CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
for ac_func in getenv atol sbrk abort atof getcwd getwd \
strsignal putc_unlocked fputs_unlocked fwrite_unlocked \
fprintf_unlocked strstr errno snprintf vasprintf \
malloc realloc calloc free basename getopt clock getpagesize
for ac_func in getenv atol sbrk abort atof getcwd getwd strsignal \
strstr errno snprintf vasprintf malloc realloc calloc free \
basename getopt clock getpagesize clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked
do
ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp`
echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5
......
......@@ -977,11 +977,15 @@ fi
dnl Disabled until we have a complete test for buggy enum bitfields.
dnl gcc_AC_C_ENUM_BF_UNSIGNED
define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
putchar_unlocked putc_unlocked)
AC_CHECK_FUNCS(times clock dup2 kill getrlimit setrlimit atoll atoq \
sysconf strsignal putc_unlocked fputc_unlocked fputs_unlocked \
fwrite_unlocked fprintf_unlocked getrusage nl_langinfo \
scandir alphasort gettimeofday mbstowcs wcswidth mmap mincore \
setlocale)
sysconf strsignal getrusage nl_langinfo scandir alphasort \
gettimeofday mbstowcs wcswidth mmap mincore setlocale \
gcc_UNLOCKED_FUNCS)
if test x$ac_cv_func_mbstowcs = xyes; then
AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works,
......@@ -1048,10 +1052,9 @@ AM_LANGINFO_CODESET
# We will need to find libiberty.h and ansidecl.h
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -I${srcdir} -I${srcdir}/../include"
gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd \
strsignal putc_unlocked fputs_unlocked fwrite_unlocked \
fprintf_unlocked strstr errno snprintf vasprintf \
malloc realloc calloc free basename getopt clock getpagesize, , ,[
gcc_AC_CHECK_DECLS(getenv atol sbrk abort atof getcwd getwd strsignal \
strstr errno snprintf vasprintf malloc realloc calloc free \
basename getopt clock getpagesize gcc_UNLOCKED_FUNCS, , ,[
#include "ansidecl.h"
#include "system.h"])
......
......@@ -65,11 +65,65 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# undef putc
# define putc(C, Stream) putc_unlocked (C, Stream)
# endif
# ifdef HAVE_PUTCHAR_UNLOCKED
# undef putchar
# define putchar(C) putchar_unlocked (C)
# endif
# ifdef HAVE_GETC_UNLOCKED
# undef getc
# define getc(Stream) getc_unlocked (Stream)
# endif
# ifdef HAVE_GETCHAR_UNLOCKED
# undef getchar
# define getchar() getchar_unlocked ()
# endif
# ifdef HAVE_FPUTC_UNLOCKED
# undef fputc
# define fputc(C, Stream) fputc_unlocked (C, Stream)
# endif
# ifdef HAVE_CLEARERR_UNLOCKED
# undef clearerr
# define clearerr(Stream) clearerr_unlocked (Stream)
# if defined (HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED
extern void clearerr_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FEOF_UNLOCKED
# undef feof
# define feof(Stream) feof_unlocked (Stream)
# if defined (HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED
extern int feof_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FILENO_UNLOCKED
# undef fileno
# define fileno(Stream) fileno_unlocked (Stream)
# if defined (HAVE_DECL_FILENO_UNLOCKED) && !HAVE_DECL_FILENO_UNLOCKED
extern int fileno_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FFLUSH_UNLOCKED
# undef fflush
# define fflush(Stream) fflush_unlocked (Stream)
# if defined (HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED
extern int fflush_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FGETC_UNLOCKED
# undef fgetc
# define fgetc(Stream) fgetc_unlocked (Stream)
# if defined (HAVE_DECL_FGETC_UNLOCKED) && !HAVE_DECL_FGETC_UNLOCKED
extern int fgetc_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FGETS_UNLOCKED
# undef fgets
# define fgets(S, n, Stream) fgets_unlocked (S, n, Stream)
# if defined (HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED
extern char *fgets_unlocked (char *, int, FILE *);
# endif
# endif
# ifdef HAVE_FPUTS_UNLOCKED
# undef fputs
# define fputs(String, Stream) fputs_unlocked (String, Stream)
......@@ -77,11 +131,25 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
extern int fputs_unlocked (const char *, FILE *);
# endif
# endif
# ifdef HAVE_FERROR_UNLOCKED
# undef ferror
# define ferror(Stream) ferror_unlocked (Stream)
# if defined (HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED
extern int ferror_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FREAD_UNLOCKED
# undef fread
# define fread(Ptr, Size, N, Stream) fread_unlocked (Ptr, Size, N, Stream)
# if defined (HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED
extern size_t fread_unlocked (void *, size_t, size_t, FILE *);
# endif
# endif
# ifdef HAVE_FWRITE_UNLOCKED
# undef fwrite
# define fwrite(Ptr, Size, N, Stream) fwrite_unlocked (Ptr, Size, N, Stream)
# if defined (HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
extern int fwrite_unlocked (const void *, size_t, size_t, FILE *);
extern size_t fwrite_unlocked (const void *, size_t, size_t, FILE *);
# endif
# endif
# ifdef HAVE_FPRINTF_UNLOCKED
......
2005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* configure.ac (libcpp_UNLOCKED_FUNCS): New.
(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
* system.h (putchar, getc, getchar, clearerr, feof, fileno,
fflush, fgetc, fgets, ferror, fread): Redefine to the associated
_unlocked function.
(fwrite_unlocked): Fix prototype.
* configure, config.in: Regenerate.
2005-04-05 Jakub Jelinek <jakub@redhat.com>
PR preprocessor/19475
......
......@@ -22,6 +22,9 @@
*/
#undef HAVE_ALLOCA_H
/* Define to 1 if you have the `clearerr_unlocked' function. */
#undef HAVE_CLEARERR_UNLOCKED
/* Define to 1 if you have the declaration of `abort', and to 0 if you don't.
*/
#undef HAVE_DECL_ABORT
......@@ -30,10 +33,38 @@
don't. */
#undef HAVE_DECL_BASENAME
/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_CLEARERR_UNLOCKED
/* Define to 1 if you have the declaration of `errno', and to 0 if you don't.
*/
#undef HAVE_DECL_ERRNO
/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_FEOF_UNLOCKED
/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FERROR_UNLOCKED
/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FFLUSH_UNLOCKED
/* Define to 1 if you have the declaration of `fgetc_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FGETC_UNLOCKED
/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FGETS_UNLOCKED
/* Define to 1 if you have the declaration of `fileno_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FILENO_UNLOCKED
/* Define to 1 if you have the declaration of `fprintf_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FPRINTF_UNLOCKED
......@@ -46,14 +77,30 @@
you don't. */
#undef HAVE_DECL_FPUTS_UNLOCKED
/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FREAD_UNLOCKED
/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_FWRITE_UNLOCKED
/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_GETCHAR_UNLOCKED
/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_GETC_UNLOCKED
/* Define to 1 if you have the declaration of `getopt', and to 0 if you don't.
*/
#undef HAVE_DECL_GETOPT
/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if
you don't. */
#undef HAVE_DECL_PUTCHAR_UNLOCKED
/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you
don't. */
#undef HAVE_DECL_PUTC_UNLOCKED
......@@ -61,6 +108,24 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `feof_unlocked' function. */
#undef HAVE_FEOF_UNLOCKED
/* Define to 1 if you have the `ferror_unlocked' function. */
#undef HAVE_FERROR_UNLOCKED
/* Define to 1 if you have the `fflush_unlocked' function. */
#undef HAVE_FFLUSH_UNLOCKED
/* Define to 1 if you have the `fgetc_unlocked' function. */
#undef HAVE_FGETC_UNLOCKED
/* Define to 1 if you have the `fgets_unlocked' function. */
#undef HAVE_FGETS_UNLOCKED
/* Define to 1 if you have the `fileno_unlocked' function. */
#undef HAVE_FILENO_UNLOCKED
/* Define to 1 if you have the `fprintf_unlocked' function. */
#undef HAVE_FPRINTF_UNLOCKED
......@@ -70,9 +135,18 @@
/* Define to 1 if you have the `fputs_unlocked' function. */
#undef HAVE_FPUTS_UNLOCKED
/* Define to 1 if you have the `fread_unlocked' function. */
#undef HAVE_FREAD_UNLOCKED
/* Define to 1 if you have the `fwrite_unlocked' function. */
#undef HAVE_FWRITE_UNLOCKED
/* Define to 1 if you have the `getchar_unlocked' function. */
#undef HAVE_GETCHAR_UNLOCKED
/* Define to 1 if you have the `getc_unlocked' function. */
#undef HAVE_GETC_UNLOCKED
/* Define if you have the iconv() function. */
#undef HAVE_ICONV
......@@ -97,6 +171,9 @@
/* Define to 1 if libc includes obstacks. */
#undef HAVE_OBSTACK
/* Define to 1 if you have the `putchar_unlocked' function. */
#undef HAVE_PUTCHAR_UNLOCKED
/* Define to 1 if you have the `putc_unlocked' function. */
#undef HAVE_PUTC_UNLOCKED
......
......@@ -44,10 +44,13 @@ AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_FUNCS(putc_unlocked fputc_unlocked fputs_unlocked \
fwrite_unlocked fprintf_unlocked)
AC_CHECK_DECLS([abort, basename, errno, getopt, putc_unlocked, fputc_unlocked,
fputs_unlocked, fwrite_unlocked, fprintf_unlocked])
define(libcpp_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
putchar_unlocked putc_unlocked)
AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
AC_CHECK_DECLS(m4_split(m4_normalize(abort basename errno getopt libcpp_UNLOCKED_FUNCS)))
# Checks for library functions.
AC_FUNC_ALLOCA
......
......@@ -57,11 +57,65 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# undef putc
# define putc(C, Stream) putc_unlocked (C, Stream)
# endif
# ifdef HAVE_PUTCHAR_UNLOCKED
# undef putchar
# define putchar(C) putchar_unlocked (C)
# endif
# ifdef HAVE_GETC_UNLOCKED
# undef getc
# define getc(Stream) getc_unlocked (Stream)
# endif
# ifdef HAVE_GETCHAR_UNLOCKED
# undef getchar
# define getchar() getchar_unlocked ()
# endif
# ifdef HAVE_FPUTC_UNLOCKED
# undef fputc
# define fputc(C, Stream) fputc_unlocked (C, Stream)
# endif
# ifdef HAVE_CLEARERR_UNLOCKED
# undef clearerr
# define clearerr(Stream) clearerr_unlocked (Stream)
# if defined (HAVE_DECL_CLEARERR_UNLOCKED) && !HAVE_DECL_CLEARERR_UNLOCKED
extern void clearerr_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FEOF_UNLOCKED
# undef feof
# define feof(Stream) feof_unlocked (Stream)
# if defined (HAVE_DECL_FEOF_UNLOCKED) && !HAVE_DECL_FEOF_UNLOCKED
extern int feof_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FILENO_UNLOCKED
# undef fileno
# define fileno(Stream) fileno_unlocked (Stream)
# if defined (HAVE_DECL_FILENO_UNLOCKED) && !HAVE_DECL_FILENO_UNLOCKED
extern int fileno_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FFLUSH_UNLOCKED
# undef fflush
# define fflush(Stream) fflush_unlocked (Stream)
# if defined (HAVE_DECL_FFLUSH_UNLOCKED) && !HAVE_DECL_FFLUSH_UNLOCKED
extern int fflush_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FGETC_UNLOCKED
# undef fgetc
# define fgetc(Stream) fgetc_unlocked (Stream)
# if defined (HAVE_DECL_FGETC_UNLOCKED) && !HAVE_DECL_FGETC_UNLOCKED
extern int fgetc_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FGETS_UNLOCKED
# undef fgets
# define fgets(S, n, Stream) fgets_unlocked (S, n, Stream)
# if defined (HAVE_DECL_FGETS_UNLOCKED) && !HAVE_DECL_FGETS_UNLOCKED
extern char *fgets_unlocked (char *, int, FILE *);
# endif
# endif
# ifdef HAVE_FPUTS_UNLOCKED
# undef fputs
# define fputs(String, Stream) fputs_unlocked (String, Stream)
......@@ -69,11 +123,25 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
extern int fputs_unlocked (const char *, FILE *);
# endif
# endif
# ifdef HAVE_FERROR_UNLOCKED
# undef ferror
# define ferror(Stream) ferror_unlocked (Stream)
# if defined (HAVE_DECL_FERROR_UNLOCKED) && !HAVE_DECL_FERROR_UNLOCKED
extern int ferror_unlocked (FILE *);
# endif
# endif
# ifdef HAVE_FREAD_UNLOCKED
# undef fread
# define fread(Ptr, Size, N, Stream) fread_unlocked (Ptr, Size, N, Stream)
# if defined (HAVE_DECL_FREAD_UNLOCKED) && !HAVE_DECL_FREAD_UNLOCKED
extern size_t fread_unlocked (void *, size_t, size_t, FILE *);
# endif
# endif
# ifdef HAVE_FWRITE_UNLOCKED
# undef fwrite
# define fwrite(Ptr, Size, N, Stream) fwrite_unlocked (Ptr, Size, N, Stream)
# if defined (HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
extern int fwrite_unlocked (const void *, size_t, size_t, FILE *);
extern size_t fwrite_unlocked (const void *, size_t, size_t, FILE *);
# endif
# endif
# ifdef HAVE_FPRINTF_UNLOCKED
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment