diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2005-04-11 21:46:59 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2005-04-11 21:46:59 +0000 |
commit | 0d667716cb63716aefc44dce80607afad25ad28c (patch) | |
tree | bcbd909493a495297ca2b985d2ff663a494ec0d9 /libcpp | |
parent | 37cca405546085f77cff5a0bacc334c77422587f (diff) | |
download | gcc-0d667716cb63716aefc44dce80607afad25ad28c.zip gcc-0d667716cb63716aefc44dce80607afad25ad28c.tar.gz gcc-0d667716cb63716aefc44dce80607afad25ad28c.tar.bz2 |
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
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 11 | ||||
-rw-r--r-- | libcpp/config.in | 77 | ||||
-rwxr-xr-x | libcpp/configure | 833 | ||||
-rw-r--r-- | libcpp/configure.ac | 11 | ||||
-rw-r--r-- | libcpp/system.h | 70 |
5 files changed, 971 insertions, 31 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 48b24ec..6151186 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,14 @@ +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 diff --git a/libcpp/config.in b/libcpp/config.in index d7f67a6..a302492 100644 --- a/libcpp/config.in +++ b/libcpp/config.in @@ -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 diff --git a/libcpp/configure b/libcpp/configure index db58fcc..915b4cb 100755 --- a/libcpp/configure +++ b/libcpp/configure @@ -4894,8 +4894,19 @@ _ACEOF -for ac_func in putc_unlocked fputc_unlocked fputs_unlocked \ - fwrite_unlocked fprintf_unlocked + + + + + + + + + + + + +for ac_func in 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 @@ -5276,9 +5287,9 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 -echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then +echo "$as_me:$LINENO: checking whether clearerr_unlocked is declared" >&5 +echo $ECHO_N "checking whether clearerr_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_clearerr_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5291,8 +5302,8 @@ $ac_includes_default int main () { -#ifndef putc_unlocked - char *p = (char *) putc_unlocked; +#ifndef clearerr_unlocked + char *p = (char *) clearerr_unlocked; #endif ; @@ -5321,27 +5332,517 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_have_decl_putc_unlocked=yes + ac_cv_have_decl_clearerr_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_putc_unlocked=no +ac_cv_have_decl_clearerr_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6 -if test $ac_cv_have_decl_putc_unlocked = yes; then +echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6 +if test $ac_cv_have_decl_clearerr_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 1 +#define HAVE_DECL_CLEARERR_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED 0 +#define HAVE_DECL_CLEARERR_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether feof_unlocked is declared" >&5 +echo $ECHO_N "checking whether feof_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_feof_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef feof_unlocked + char *p = (char *) feof_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_feof_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_feof_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6 +if test $ac_cv_have_decl_feof_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FEOF_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FEOF_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether ferror_unlocked is declared" >&5 +echo $ECHO_N "checking whether ferror_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_ferror_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef ferror_unlocked + char *p = (char *) ferror_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_ferror_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_ferror_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6 +if test $ac_cv_have_decl_ferror_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FERROR_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FERROR_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fflush_unlocked is declared" >&5 +echo $ECHO_N "checking whether fflush_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fflush_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fflush_unlocked + char *p = (char *) fflush_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fflush_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fflush_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6 +if test $ac_cv_have_decl_fflush_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FFLUSH_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FFLUSH_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fgetc_unlocked is declared" >&5 +echo $ECHO_N "checking whether fgetc_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fgetc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fgetc_unlocked + char *p = (char *) fgetc_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fgetc_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fgetc_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgetc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fgetc_unlocked" >&6 +if test $ac_cv_have_decl_fgetc_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETC_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETC_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fgets_unlocked is declared" >&5 +echo $ECHO_N "checking whether fgets_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fgets_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fgets_unlocked + char *p = (char *) fgets_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fgets_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fgets_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6 +if test $ac_cv_have_decl_fgets_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETS_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETS_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fileno_unlocked is declared" >&5 +echo $ECHO_N "checking whether fileno_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fileno_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fileno_unlocked + char *p = (char *) fileno_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fileno_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fileno_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fileno_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fileno_unlocked" >&6 +if test $ac_cv_have_decl_fileno_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FILENO_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FILENO_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether fprintf_unlocked is declared" >&5 +echo $ECHO_N "checking whether fprintf_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fprintf_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fprintf_unlocked + char *p = (char *) fprintf_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fprintf_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fprintf_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fprintf_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fprintf_unlocked" >&6 +if test $ac_cv_have_decl_fprintf_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPRINTF_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPRINTF_UNLOCKED 0 _ACEOF @@ -5486,6 +5987,76 @@ _ACEOF fi +echo "$as_me:$LINENO: checking whether fread_unlocked is declared" >&5 +echo $ECHO_N "checking whether fread_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_fread_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef fread_unlocked + char *p = (char *) fread_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_fread_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_fread_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6 +if test $ac_cv_have_decl_fread_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FREAD_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FREAD_UNLOCKED 0 +_ACEOF + + +fi echo "$as_me:$LINENO: checking whether fwrite_unlocked is declared" >&5 echo $ECHO_N "checking whether fwrite_unlocked is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_fwrite_unlocked+set}" = set; then @@ -5556,9 +6127,9 @@ _ACEOF fi -echo "$as_me:$LINENO: checking whether fprintf_unlocked is declared" >&5 -echo $ECHO_N "checking whether fprintf_unlocked is declared... $ECHO_C" >&6 -if test "${ac_cv_have_decl_fprintf_unlocked+set}" = set; then +echo "$as_me:$LINENO: checking whether getchar_unlocked is declared" >&5 +echo $ECHO_N "checking whether getchar_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_getchar_unlocked+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5571,8 +6142,8 @@ $ac_includes_default int main () { -#ifndef fprintf_unlocked - char *p = (char *) fprintf_unlocked; +#ifndef getchar_unlocked + char *p = (char *) getchar_unlocked; #endif ; @@ -5601,27 +6172,237 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_have_decl_fprintf_unlocked=yes + ac_cv_have_decl_getchar_unlocked=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_have_decl_fprintf_unlocked=no +ac_cv_have_decl_getchar_unlocked=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_have_decl_fprintf_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_decl_fprintf_unlocked" >&6 -if test $ac_cv_have_decl_fprintf_unlocked = yes; then +echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6 +if test $ac_cv_have_decl_getchar_unlocked = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPRINTF_UNLOCKED 1 +#define HAVE_DECL_GETCHAR_UNLOCKED 1 _ACEOF else cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPRINTF_UNLOCKED 0 +#define HAVE_DECL_GETCHAR_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether getc_unlocked is declared" >&5 +echo $ECHO_N "checking whether getc_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_getc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef getc_unlocked + char *p = (char *) getc_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_getc_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_getc_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6 +if test $ac_cv_have_decl_getc_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETC_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether putchar_unlocked is declared" >&5 +echo $ECHO_N "checking whether putchar_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_putchar_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef putchar_unlocked + char *p = (char *) putchar_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_putchar_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_putchar_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6 +if test $ac_cv_have_decl_putchar_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTCHAR_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTCHAR_UNLOCKED 0 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking whether putc_unlocked is declared" >&5 +echo $ECHO_N "checking whether putc_unlocked is declared... $ECHO_C" >&6 +if test "${ac_cv_have_decl_putc_unlocked+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef putc_unlocked + char *p = (char *) putc_unlocked; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_have_decl_putc_unlocked=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_have_decl_putc_unlocked=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6 +if test $ac_cv_have_decl_putc_unlocked = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED 0 _ACEOF diff --git a/libcpp/configure.ac b/libcpp/configure.ac index aa93f65..b56a744 100644 --- a/libcpp/configure.ac +++ b/libcpp/configure.ac @@ -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 diff --git a/libcpp/system.h b/libcpp/system.h index 4f91aa5..560fa18 100644 --- a/libcpp/system.h +++ b/libcpp/system.h @@ -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 |