X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fungetc.m4;h=749f6bd5dc8b89e621fab69439066d4816f6c383;hb=ae006b4d5d64c1a5e1ac2b5bd45350d4d3ebb060;hp=9236d4c8367337b035081a3362ab89c2232a6596;hpb=5812ea3e47b3db87cc42c99b1d3cd8e44c8c0af3;p=gnulib.git diff --git a/m4/ungetc.m4 b/m4/ungetc.m4 index 9236d4c83..749f6bd5d 100644 --- a/m4/ungetc.m4 +++ b/m4/ungetc.m4 @@ -1,5 +1,5 @@ -# ungetc.m4 serial 1 -dnl Copyright (C) 2009 Free Software Foundation, Inc. +# ungetc.m4 serial 2 +dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -12,22 +12,22 @@ AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS], [gl_cv_func_ungetc_works], [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include - ]], [FILE *f; long l; - if (!(f = fopen ("conftest.tmp", "w+"))) return 1; - if (fputs ("abc", f) < 0) return 2; - rewind (f); - if (fgetc (f) != 'a') return 3; - if (fgetc (f) != 'b') return 4; - if (ungetc ('d', f) != 'd') return 5; - if (ftell (f) != 1) return 6; - if (fgetc (f) != 'd') return 7; - if (ftell (f) != 2) return 8; - if (fseek (f, 0, SEEK_CUR) != 0) return 9; - if (ftell (f) != 2) return 10; - if (fgetc (f) != 'c') return 11; - fclose (f); remove ("conftest.tmp");])], - [gl_cv_func_ungetc_works=yes], [gl_cv_func_ungetc_works=no], - [gl_cv_func_ungetc_works='guessing no']) + ]], [FILE *f; + if (!(f = fopen ("conftest.tmp", "w+"))) return 1; + if (fputs ("abc", f) < 0) return 2; + rewind (f); + if (fgetc (f) != 'a') return 3; + if (fgetc (f) != 'b') return 4; + if (ungetc ('d', f) != 'd') return 5; + if (ftell (f) != 1) return 6; + if (fgetc (f) != 'd') return 7; + if (ftell (f) != 2) return 8; + if (fseek (f, 0, SEEK_CUR) != 0) return 9; + if (ftell (f) != 2) return 10; + if (fgetc (f) != 'c') return 11; + fclose (f); remove ("conftest.tmp");])], + [gl_cv_func_ungetc_works=yes], [gl_cv_func_ungetc_works=no], + [gl_cv_func_ungetc_works='guessing no']) ]) if test "$gl_cv_func_ungetc_works" != yes; then AC_DEFINE([FUNC_UNGETC_BROKEN], [1],