diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/config.in | 81 | ||||
-rwxr-xr-x | gcc/configure | 38 | ||||
-rw-r--r-- | gcc/configure.ac | 19 | ||||
-rw-r--r-- | gcc/system.h | 70 |
5 files changed, 203 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 60e5aa3..0c7d095 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +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. diff --git a/gcc/config.in b/gcc/config.in index eb58153..996c2f8 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -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 diff --git a/gcc/configure b/gcc/configure index b382766..1d96694 100755 --- a/gcc/configure +++ b/gcc/configure @@ -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 diff --git a/gcc/configure.ac b/gcc/configure.ac index 0697113..a2239a5 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -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"]) diff --git a/gcc/system.h b/gcc/system.h index 6fec6a6..35581a0 100644 --- a/gcc/system.h +++ b/gcc/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 |