summaryrefslogtreecommitdiff
path: root/lgl
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-04-18 09:28:07 +0200
committerSimon Josefsson <simon@josefsson.org>2008-04-18 09:28:07 +0200
commitae98ce038adc0680785c8e911589676e64b55465 (patch)
tree809d8e46707e305b624b73eb4cb9a31585532ae2 /lgl
parent7718d3a0efb931dd9bfe1f685fcd518ef1677390 (diff)
downloadgnutls-ae98ce038adc0680785c8e911589676e64b55465.tar.gz
Move fseeko to lgl/ from gl/ for opencdk.
Diffstat (limited to 'lgl')
-rw-r--r--lgl/Makefile.am20
-rw-r--r--lgl/fseeko.c138
-rw-r--r--lgl/lseek.c62
-rw-r--r--lgl/m4/extensions.m46
-rw-r--r--lgl/m4/fseeko.m434
-rw-r--r--lgl/m4/gnulib-cache.m44
-rw-r--r--lgl/m4/gnulib-comp.m49
-rw-r--r--lgl/m4/lseek.m450
-rw-r--r--lgl/m4/memmem.m46
-rw-r--r--lgl/m4/stdint.m46
-rw-r--r--lgl/m4/stdio_h.m410
-rw-r--r--lgl/m4/sys_socket_h.m44
12 files changed, 330 insertions, 19 deletions
diff --git a/lgl/Makefile.am b/lgl/Makefile.am
index 3f0e17eafb..de36c54eca 100644
--- a/lgl/Makefile.am
+++ b/lgl/Makefile.am
@@ -9,7 +9,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=lgl/override --lib=liblgnu --source-base=lgl --m4-base=lgl/m4 --doc-base=doc --aux-dir=build-aux --lgpl=2 --libtool --macro-prefix=lgl --no-vc-files crypto/gc crypto/gc-arcfour crypto/gc-arctwo crypto/gc-camellia crypto/gc-des crypto/gc-hmac-md5 crypto/gc-md2 crypto/gc-md4 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random crypto/gc-rijndael crypto/gc-sha1 func gettext memmem-simple memmove minmax read-file snprintf socklen stdint strverscmp sys_socket sys_stat time_r unistd vasprintf
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=lgl/override --lib=liblgnu --source-base=lgl --m4-base=lgl/m4 --doc-base=doc --aux-dir=build-aux --lgpl=2 --libtool --macro-prefix=lgl --no-vc-files crypto/gc crypto/gc-arcfour crypto/gc-arctwo crypto/gc-camellia crypto/gc-des crypto/gc-hmac-md5 crypto/gc-md2 crypto/gc-md4 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random crypto/gc-rijndael crypto/gc-sha1 fseeko func gettext memmem-simple memmove minmax read-file snprintf socklen stdint strverscmp sys_socket sys_stat time_r unistd vasprintf
AUTOMAKE_OPTIONS = 1.5 gnits
@@ -184,6 +184,15 @@ EXTRA_DIST += float.in.h
## end gnulib module float
+## begin gnulib module fseeko
+
+
+EXTRA_DIST += fseeko.c
+
+EXTRA_liblgnu_la_SOURCES += fseeko.c
+
+## end gnulib module fseeko
+
## begin gnulib module gettext
# This is for those projects which use "gettextize --intl" to put a source-code
@@ -221,6 +230,15 @@ EXTRA_DIST += $(top_srcdir)/build-aux/link-warning.h
## end gnulib module link-warning
+## begin gnulib module lseek
+
+
+EXTRA_DIST += lseek.c
+
+EXTRA_liblgnu_la_SOURCES += lseek.c
+
+## end gnulib module lseek
+
## begin gnulib module memchr
diff --git a/lgl/fseeko.c b/lgl/fseeko.c
new file mode 100644
index 0000000000..f053cf8848
--- /dev/null
+++ b/lgl/fseeko.c
@@ -0,0 +1,138 @@
+/* An fseeko() function that, together with fflush(), is POSIX compliant.
+ Copyright (C) 2007-2008 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License along
+ with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+
+/* Specification. */
+#include <stdio.h>
+
+/* Get off_t and lseek. */
+#include <unistd.h>
+
+#undef fseeko
+#if !HAVE_FSEEKO
+# undef fseek
+# define fseeko fseek
+#endif
+
+int
+rpl_fseeko (FILE *fp, off_t offset, int whence)
+{
+#if LSEEK_PIPE_BROKEN
+ /* mingw gives bogus answers rather than failure on non-seekable files. */
+ if (lseek (fileno (fp), 0, SEEK_CUR) == -1)
+ return EOF;
+#endif
+
+ /* These tests are based on fpurge.c. */
+#if defined _IO_ferror_unlocked || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Linux libc5 */
+ if (fp->_IO_read_end == fp->_IO_read_ptr
+ && fp->_IO_write_ptr == fp->_IO_write_base
+ && fp->_IO_save_base == NULL)
+#elif defined __sferror /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
+# if defined __NetBSD__ || defined __OpenBSD__ /* NetBSD, OpenBSD */
+ /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
+ and <http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */
+# define fp_ub ((struct { struct __sbuf _ub; } *) fp->_ext._base)->_ub
+# else /* FreeBSD, MacOS X, Cygwin */
+# define fp_ub fp->_ub
+# endif
+# if defined __SL64 && defined __SCLE /* Cygwin */
+ if ((fp->_flags & __SL64) == 0)
+ {
+ /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit
+ mode; but has an fseeko that requires 64-bit mode. */
+ FILE *tmp = fopen ("/dev/null", "r");
+ if (!tmp)
+ return -1;
+ fp->_flags |= __SL64;
+ fp->_seek64 = tmp->_seek64;
+ fclose (tmp);
+ }
+# endif
+ if (fp->_p == fp->_bf._base
+ && fp->_r == 0
+ && fp->_w == ((fp->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
+ ? fp->_bf._size
+ : 0)
+ && fp_ub._base == NULL)
+#elif defined __EMX__ /* emx+gcc */
+ if (fp->_ptr == fp->_buffer
+ && fp->_rcount == 0
+ && fp->_wcount == 0
+ && fp->_ungetc_count == 0)
+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+# if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
+# define fp_ ((struct { unsigned char *_ptr; \
+ unsigned char *_base; \
+ unsigned char *_end; \
+ long _cnt; \
+ int _file; \
+ unsigned int _flag; \
+ } *) fp)
+ if (fp_->_ptr == fp_->_base
+ && (fp_->_ptr == NULL || fp_->_cnt == 0))
+# else
+# if defined _SCO_DS /* OpenServer */
+# define _base __base
+# define _ptr __ptr
+# define _cnt __cnt
+# endif
+ if (fp->_ptr == fp->_base
+ && (fp->_ptr == NULL || fp->_cnt == 0))
+# endif
+#elif defined __UCLIBC__ /* uClibc */
+ if (((fp->__modeflags & __FLAG_WRITING) == 0
+ || fp->__bufpos == fp->__bufstart)
+ && ((fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) == 0
+ || fp->__bufpos == fp->__bufread))
+#elif defined __QNX__ /* QNX */
+ if ((fp->_Mode & _MWRITE ? fp->_Next == fp->_Buf : fp->_Next == fp->_Rend)
+ && fp->_Rback == fp->_Back + sizeof (fp->_Back)
+ && fp->_Rsave == NULL)
+#else
+ #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib."
+#endif
+ {
+ off_t pos = lseek (fileno (fp), offset, whence);
+ if (pos == -1)
+ {
+#if defined __sferror /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
+ fp->_flags &= ~__SOFF;
+#endif
+ return -1;
+ }
+ else
+ {
+#if defined __sferror /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
+ fp->_offset = pos;
+ fp->_flags |= __SOFF;
+ fp->_flags &= ~__SEOF;
+#elif defined __EMX__ /* emx+gcc */
+ fp->_flags &= ~_IOEOF;
+#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+# if defined _SCO_DS /* OpenServer */
+# define _flag __flag
+# endif
+ fp->_flag &= ~_IOEOF;
+#endif
+ return 0;
+ }
+ }
+ else
+ return fseeko (fp, offset, whence);
+}
diff --git a/lgl/lseek.c b/lgl/lseek.c
new file mode 100644
index 0000000000..feec8310bd
--- /dev/null
+++ b/lgl/lseek.c
@@ -0,0 +1,62 @@
+/* An lseek() function that detects pipes.
+ Copyright (C) 2007 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License along
+ with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* Windows platforms. */
+/* Get GetFileType. */
+# include <windows.h>
+#else
+# include <sys/stat.h>
+#endif
+#include <errno.h>
+
+#undef lseek
+
+off_t
+rpl_lseek (int fd, off_t offset, int whence)
+{
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+ /* mingw lseek mistakenly succeeds on pipes, sockets, and terminals. */
+ HANDLE h = (HANDLE) _get_osfhandle (fd);
+ if (h == INVALID_HANDLE_VALUE)
+ {
+ errno = EBADF;
+ return -1;
+ }
+ if (GetFileType (h) != FILE_TYPE_DISK)
+ {
+ errno = ESPIPE;
+ return -1;
+ }
+#else
+ /* BeOS lseek mistakenly succeeds on pipes... */
+ struct stat statbuf;
+ if (fstat (fd, &statbuf) < 0)
+ return -1;
+ if (!S_ISREG (statbuf.st_mode))
+ {
+ errno = ESPIPE;
+ return -1;
+ }
+#endif
+ return lseek (fd, offset, whence);
+}
diff --git a/lgl/m4/extensions.m4 b/lgl/m4/extensions.m4
index bcbb3ceee2..917af94805 100644
--- a/lgl/m4/extensions.m4
+++ b/lgl/m4/extensions.m4
@@ -1,7 +1,7 @@
# serial 5 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -61,9 +61,9 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
[ac_cv_safe_to_define___extensions__],
[AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([
+ [AC_LANG_PROGRAM([[
# define __EXTENSIONS__ 1
- AC_INCLUDES_DEFAULT])],
+ ]AC_INCLUDES_DEFAULT])],
[ac_cv_safe_to_define___extensions__=yes],
[ac_cv_safe_to_define___extensions__=no])])
test $ac_cv_safe_to_define___extensions__ = yes &&
diff --git a/lgl/m4/fseeko.m4 b/lgl/m4/fseeko.m4
new file mode 100644
index 0000000000..3d77365688
--- /dev/null
+++ b/lgl/m4/fseeko.m4
@@ -0,0 +1,34 @@
+# fseeko.m4 serial 4
+dnl Copyright (C) 2007-2008 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.
+
+AC_DEFUN([gl_FUNC_FSEEKO],
+[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_REQUIRE([gl_STDIN_LARGE_OFFSET])
+
+ dnl Persuade glibc <stdio.h> to declare fseeko().
+ AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+ AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
+ [
+ AC_TRY_LINK([#include <stdio.h>], [fseeko (stdin, 0, 0);],
+ [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
+ ])
+ if test $gl_cv_func_fseeko = no; then
+ HAVE_FSEEKO=0
+ gl_REPLACE_FSEEKO
+ elif test $gl_cv_var_stdin_large_offset = no; then
+ gl_REPLACE_FSEEKO
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_FSEEKO],
+[
+ AC_LIBOBJ([fseeko])
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ REPLACE_FSEEKO=1
+])
diff --git a/lgl/m4/gnulib-cache.m4 b/lgl/m4/gnulib-cache.m4
index b081708467..028a69dcc9 100644
--- a/lgl/m4/gnulib-cache.m4
+++ b/lgl/m4/gnulib-cache.m4
@@ -15,11 +15,11 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --local-dir=lgl/override --lib=liblgnu --source-base=lgl --m4-base=lgl/m4 --doc-base=doc --aux-dir=build-aux --lgpl=2 --libtool --macro-prefix=lgl --no-vc-files crypto/gc crypto/gc-arcfour crypto/gc-arctwo crypto/gc-camellia crypto/gc-des crypto/gc-hmac-md5 crypto/gc-md2 crypto/gc-md4 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random crypto/gc-rijndael crypto/gc-sha1 func gettext memmem-simple memmove minmax read-file snprintf socklen stdint strverscmp sys_socket sys_stat time_r unistd vasprintf
+# gnulib-tool --import --dir=. --local-dir=lgl/override --lib=liblgnu --source-base=lgl --m4-base=lgl/m4 --doc-base=doc --aux-dir=build-aux --lgpl=2 --libtool --macro-prefix=lgl --no-vc-files crypto/gc crypto/gc-arcfour crypto/gc-arctwo crypto/gc-camellia crypto/gc-des crypto/gc-hmac-md5 crypto/gc-md2 crypto/gc-md4 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random crypto/gc-rijndael crypto/gc-sha1 fseeko func gettext memmem-simple memmove minmax read-file snprintf socklen stdint strverscmp sys_socket sys_stat time_r unistd vasprintf
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([lgl/override])
-gl_MODULES([crypto/gc crypto/gc-arcfour crypto/gc-arctwo crypto/gc-camellia crypto/gc-des crypto/gc-hmac-md5 crypto/gc-md2 crypto/gc-md4 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random crypto/gc-rijndael crypto/gc-sha1 func gettext memmem-simple memmove minmax read-file snprintf socklen stdint strverscmp sys_socket sys_stat time_r unistd vasprintf])
+gl_MODULES([crypto/gc crypto/gc-arcfour crypto/gc-arctwo crypto/gc-camellia crypto/gc-des crypto/gc-hmac-md5 crypto/gc-md2 crypto/gc-md4 crypto/gc-md5 crypto/gc-pbkdf2-sha1 crypto/gc-random crypto/gc-rijndael crypto/gc-sha1 fseeko func gettext memmem-simple memmove minmax read-file snprintf socklen stdint strverscmp sys_socket sys_stat time_r unistd vasprintf])
gl_AVOID([])
gl_SOURCE_BASE([lgl])
gl_M4_BASE([lgl/m4])
diff --git a/lgl/m4/gnulib-comp.m4 b/lgl/m4/gnulib-comp.m4
index 3ee744ae8f..bbb61022ba 100644
--- a/lgl/m4/gnulib-comp.m4
+++ b/lgl/m4/gnulib-comp.m4
@@ -27,6 +27,7 @@ AC_DEFUN([lgl_EARLY],
AC_REQUIRE([AC_PROG_RANLIB])
AC_REQUIRE([AC_GNU_SOURCE])
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ AC_REQUIRE([AC_FUNC_FSEEKO])
])
# This macro should be invoked from ./configure.in, in the section
@@ -74,11 +75,15 @@ AC_DEFUN([lgl_INIT],
gl_MODULE_INDICATOR([gc-sha1])
gl_MD2
gl_FLOAT_H
+ gl_FUNC_FSEEKO
+ gl_STDIO_MODULE_INDICATOR([fseeko])
gl_FUNC
dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
AM_GNU_GETTEXT_VERSION([0.17])
AC_SUBST([LIBINTL])
AC_SUBST([LTLIBINTL])
+ gl_FUNC_LSEEK
+ gl_UNISTD_MODULE_INDICATOR([lseek])
gl_FUNC_MEMCHR
gl_FUNC_MEMCMP
gl_FUNC_MEMMEM_SIMPLE
@@ -243,6 +248,7 @@ AC_DEFUN([lgl_FILE_LIST], [
lib/dummy.c
lib/float+.h
lib/float.in.h
+ lib/fseeko.c
lib/gc-gnulib.c
lib/gc-libgcrypt.c
lib/gc-pbkdf2-sha1.c
@@ -251,6 +257,7 @@ AC_DEFUN([lgl_FILE_LIST], [
lib/hmac-md5.c
lib/hmac-sha1.c
lib/hmac.h
+ lib/lseek.c
lib/md2.c
lib/md2.h
lib/md4.c
@@ -305,6 +312,7 @@ AC_DEFUN([lgl_FILE_LIST], [
m4/eoverflow.m4
m4/extensions.m4
m4/float_h.m4
+ m4/fseeko.m4
m4/func.m4
m4/gc-arcfour.m4
m4/gc-arctwo.m4
@@ -342,6 +350,7 @@ AC_DEFUN([lgl_FILE_LIST], [
m4/lib-prefix.m4
m4/lock.m4
m4/longlong.m4
+ m4/lseek.m4
m4/malloc.m4
m4/md2.m4
m4/md4.m4
diff --git a/lgl/m4/lseek.m4 b/lgl/m4/lseek.m4
new file mode 100644
index 0000000000..f336990709
--- /dev/null
+++ b/lgl/m4/lseek.m4
@@ -0,0 +1,50 @@
+# lseek.m4 serial 4
+dnl Copyright (C) 2007 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.
+
+AC_DEFUN([gl_FUNC_LSEEK],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe],
+ [if test $cross_compiling = no; then
+ AC_LINK_IFELSE([
+#include <sys/types.h> /* for off_t */
+#include <stdio.h> /* for SEEK_CUR */
+#include <unistd.h>
+int main ()
+{
+ /* Exit with success only if stdin is seekable. */
+ return lseek (0, (off_t)0, SEEK_CUR) < 0;
+}],
+ [if test -s conftest$ac_exeext \
+ && ./conftest$ac_exeext < conftest.$ac_ext \
+ && { echo hi | ./conftest$ac_exeext; test $? = 1; }; then
+ gl_cv_func_lseek_pipe=yes
+ else
+ gl_cv_func_lseek_pipe=no
+ fi],
+ [gl_cv_func_lseek_pipe=no])
+ else
+ AC_COMPILE_IFELSE([
+#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined __BEOS__
+/* mingw and BeOS mistakenly return 0 when trying to seek on pipes. */
+ Choke me.
+#endif],
+ [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
+ fi])
+ if test $gl_cv_func_lseek_pipe = no; then
+ gl_REPLACE_LSEEK
+ fi
+])
+
+AC_DEFUN([gl_REPLACE_LSEEK],
+[
+ AC_LIBOBJ([lseek])
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ REPLACE_LSEEK=1
+ AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
+ [Define to 1 if lseek does not detect pipes.])
+])
diff --git a/lgl/m4/memmem.m4 b/lgl/m4/memmem.m4
index 7f3aa3c70f..383ed4b302 100644
--- a/lgl/m4/memmem.m4
+++ b/lgl/m4/memmem.m4
@@ -1,4 +1,4 @@
-# memmem.m4 serial 9
+# memmem.m4 serial 10
dnl Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -26,11 +26,11 @@ AC_DEFUN([gl_FUNC_MEMMEM],
if test $ac_cv_have_decl_memmem = yes; then
AC_CACHE_CHECK([whether memmem works in linear time],
[gl_cv_func_memmem_works],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <string.h> /* for memmem */
#include <stdlib.h> /* for malloc */
#include <unistd.h> /* for alarm */
-], [[size_t m = 1000000;
+]], [[size_t m = 1000000;
char *haystack = (char *) malloc (2 * m + 1);
char *needle = (char *) malloc (m + 1);
void *result = 0;
diff --git a/lgl/m4/stdint.m4 b/lgl/m4/stdint.m4
index 9b5001a52d..b255692567 100644
--- a/lgl/m4/stdint.m4
+++ b/lgl/m4/stdint.m4
@@ -1,4 +1,4 @@
-# stdint.m4 serial 30
+# stdint.m4 serial 31
dnl Copyright (C) 2001-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -337,9 +337,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
ui64)gltype1='unsigned __int64';;
esac
AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([$2
+ [AC_LANG_PROGRAM([$2[
extern $gltype foo;
- extern $gltype1 foo;])],
+ extern $gltype1 foo;]])],
[eval gl_cv_type_${gltype}_suffix=\$glsuf])
eval result=\$gl_cv_type_${gltype}_suffix
test "$result" != no && break
diff --git a/lgl/m4/stdio_h.m4 b/lgl/m4/stdio_h.m4
index a40d418041..fa262e359c 100644
--- a/lgl/m4/stdio_h.m4
+++ b/lgl/m4/stdio_h.m4
@@ -1,5 +1,5 @@
-# stdio_h.m4 serial 9
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# stdio_h.m4 serial 10
+dnl Copyright (C) 2007-2008 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.
@@ -70,8 +70,8 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
[
AC_CACHE_CHECK([whether stdin defaults to large file offsets],
[gl_cv_var_stdin_large_offset],
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <stdio.h>],
-[#if defined __SL64 && defined __SCLE /* cygwin */
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
+[[#if defined __SL64 && defined __SCLE /* cygwin */
/* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
it is easier to do a version check than building a runtime test. */
@@ -79,7 +79,7 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
choke me
# endif
-#endif])],
+#endif]])],
[gl_cv_var_stdin_large_offset=yes],
[gl_cv_var_stdin_large_offset=no])])
])
diff --git a/lgl/m4/sys_socket_h.m4 b/lgl/m4/sys_socket_h.m4
index 887cff80eb..0e735a93c3 100644
--- a/lgl/m4/sys_socket_h.m4
+++ b/lgl/m4/sys_socket_h.m4
@@ -1,4 +1,4 @@
-# sys_socket_h.m4 serial 5
+# sys_socket_h.m4 serial 6
dnl Copyright (C) 2005-2008 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,7 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
[gl_cv_header_sys_socket_h_selfcontained],
[
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/socket.h>], [])],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
[gl_cv_header_sys_socket_h_selfcontained=yes],
[gl_cv_header_sys_socket_h_selfcontained=no])
])