summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gl/m4/gnulib-comp.m44
-rw-r--r--gl/m4/sys_select_h.m431
-rw-r--r--gl/stdio-write.c8
-rw-r--r--gl/sys_select.in.h6
-rw-r--r--gl/tests/gettimeofday.c4
-rw-r--r--gl/tests/test-sys_select.c7
-rwxr-xr-xgl/tests/test-version-etc.sh2
-rw-r--r--lib/gl/m4/gnulib-comp.m44
-rw-r--r--lib/gl/stdio-write.c8
-rw-r--r--maint.mk6
10 files changed, 63 insertions, 17 deletions
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index cf3336d3cc..e39c73a4d4 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -75,8 +75,8 @@ AC_SUBST([LTALLOCA])
gl_HEADER_ERRNO_H
gl_ERROR
m4_ifdef([AM_XGETTEXT_OPTION],
- [AM_XGETTEXT_OPTION([--flag=error:3:c-format])
- AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
+ [AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
+ AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
gl_FUNC_FCLOSE
gl_STDIO_MODULE_INDICATOR([fclose])
gl_FLOAT_H
diff --git a/gl/m4/sys_select_h.m4 b/gl/m4/sys_select_h.m4
index c48be2ce38..0bb097e1a7 100644
--- a/gl/m4/sys_select_h.m4
+++ b/gl/m4/sys_select_h.m4
@@ -1,4 +1,4 @@
-# sys_select_h.m4 serial 7
+# sys_select_h.m4 serial 8
dnl Copyright (C) 2006-2009 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,10 +11,39 @@ AC_DEFUN([gl_HEADER_SYS_SELECT],
AC_CACHE_CHECK([whether <sys/select.h> is self-contained],
[gl_cv_header_sys_select_h_selfcontained],
[
+ dnl Test against two bugs:
+ dnl 1. On many platforms, <sys/select.h> assumes prior inclusion of
+ dnl <sys/types.h>.
+ dnl 2. On OSF/1 4.0, <sys/select.h> provides only a forward declaration
+ dnl of 'struct timeval', and no definition of this type.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/select.h>]],
[[struct timeval b;]])],
[gl_cv_header_sys_select_h_selfcontained=yes],
[gl_cv_header_sys_select_h_selfcontained=no])
+ dnl Test against another bug:
+ dnl 3. On Solaris 10, <sys/select.h> provides an FD_ZERO implementation
+ dnl that relies on memset(), but without including <string.h>.
+ if test $gl_cv_header_sys_select_h_selfcontained = yes; then
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <sys/select.h>]],
+ [[int memset; int bzero;]])
+ ],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[#include <sys/select.h>]], [[
+ #undef memset
+ #define memset nonexistent_memset
+ extern void *memset (void *, int, unsigned long);
+ #undef bzero
+ #define bzero nonexistent_bzero
+ extern void bzero (void *, unsigned long);
+ fd_set fds;
+ FD_ZERO (&fds);
+ ]])
+ ],
+ [],
+ [gl_cv_header_sys_select_h_selfcontained=no])
+ ])
+ fi
])
if test $gl_cv_header_sys_select_h_selfcontained = yes; then
SYS_SELECT_H=''
diff --git a/gl/stdio-write.c b/gl/stdio-write.c
index f1d0fcb730..15cc5ed742 100644
--- a/gl/stdio-write.c
+++ b/gl/stdio-write.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream write function.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008-2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This program is free software: you can redistribute it and/or modify
@@ -63,6 +63,7 @@
}
# if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
+# if !DEPENDS_ON_LIBINTL /* avoid collision with intl/printf.c */
int
printf (const char *format, ...)
{
@@ -75,6 +76,7 @@ printf (const char *format, ...)
return retval;
}
+# endif
# endif
# if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
@@ -92,7 +94,7 @@ fprintf (FILE *stream, const char *format, ...)
}
# endif
-# if !REPLACE_VFPRINTF_POSIX /* avoid collision with vprintf.c */
+# if !REPLACE_VPRINTF_POSIX /* avoid collision with vprintf.c */
int
vprintf (const char *format, va_list args)
{
@@ -100,7 +102,7 @@ vprintf (const char *format, va_list args)
}
# endif
-# if !REPLACE_VPRINTF_POSIX /* avoid collision with vfprintf.c */
+# if !REPLACE_VFPRINTF_POSIX /* avoid collision with vfprintf.c */
int
vfprintf (FILE *stream, const char *format, va_list args)
#undef vfprintf
diff --git a/gl/sys_select.in.h b/gl/sys_select.in.h
index e87b7d04bb..7d392a04aa 100644
--- a/gl/sys_select.in.h
+++ b/gl/sys_select.in.h
@@ -42,9 +42,13 @@
# include <sys/types.h>
/* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
- of 'struct timeval', and no definition of this type.. */
+ of 'struct timeval', and no definition of this type. */
# include <sys/time.h>
+/* On Solaris 10, <sys/select.h> provides an FD_ZERO implementation
+ that relies on memset(), but without including <string.h>. */
+# include <string.h>
+
/* The include_next requires a split double-inclusion guard. */
# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
diff --git a/gl/tests/gettimeofday.c b/gl/tests/gettimeofday.c
index eb6bf9c126..63ee747c0c 100644
--- a/gl/tests/gettimeofday.c
+++ b/gl/tests/gettimeofday.c
@@ -1,6 +1,6 @@
/* Provide gettimeofday for systems that don't have it or for which it's broken.
- Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Free Software
+ Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2009 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -111,7 +111,7 @@ rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz)
struct tm save = *localtime_buffer_addr;
# endif
- int result = gettimeofday (tv, tz);
+ int result = gettimeofday (tv, (struct timezone *) tz);
# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
*localtime_buffer_addr = save;
diff --git a/gl/tests/test-sys_select.c b/gl/tests/test-sys_select.c
index 6449dafde7..66079529ef 100644
--- a/gl/tests/test-sys_select.c
+++ b/gl/tests/test-sys_select.c
@@ -1,5 +1,5 @@
/* Test of <sys/select.h> substitute.
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 2007-2009 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,5 +26,10 @@ struct timeval t1;
int
main ()
{
+ /* Check that FD_ZERO can be used. This should not yield a warning
+ such as "warning: implicit declaration of function 'memset'". */
+ fd_set fds;
+ FD_ZERO (&fds);
+
return 0;
}
diff --git a/gl/tests/test-version-etc.sh b/gl/tests/test-version-etc.sh
index 3b2fc4db80..c88bb93c39 100755
--- a/gl/tests/test-version-etc.sh
+++ b/gl/tests/test-version-etc.sh
@@ -31,7 +31,7 @@ There is NO WARRANTY, to the extent permitted by law.
Written by Sergey Poznyakoff and Eric Blake.
EOT
-./test-version-etc --version |
+./test-version-etc${EXEEXT} --version |
sed '2s/Copyright (C) [0-9]\{4,4\}/COPYRIGHT/' |
diff -c $TMP - || ERR=1
diff --git a/lib/gl/m4/gnulib-comp.m4 b/lib/gl/m4/gnulib-comp.m4
index d11f04b936..bc89db4dd1 100644
--- a/lib/gl/m4/gnulib-comp.m4
+++ b/lib/gl/m4/gnulib-comp.m4
@@ -95,8 +95,8 @@ AC_DEFUN([lgl_INIT],
gl_FUNC_VASPRINTF
gl_STDIO_MODULE_INDICATOR([vasprintf])
m4_ifdef([AM_XGETTEXT_OPTION],
- [AM_XGETTEXT_OPTION([--flag=asprintf:2:c-format])
- AM_XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
+ [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format])
+ AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])])
gl_FUNC_VSNPRINTF
gl_STDIO_MODULE_INDICATOR([vsnprintf])
gl_WCHAR_H
diff --git a/lib/gl/stdio-write.c b/lib/gl/stdio-write.c
index 0abcfc4088..01102d66cb 100644
--- a/lib/gl/stdio-write.c
+++ b/lib/gl/stdio-write.c
@@ -1,5 +1,5 @@
/* POSIX compatible FILE stream write function.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008-2009 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2008.
This program is free software: you can redistribute it and/or modify
@@ -63,6 +63,7 @@
}
# if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
+# if !DEPENDS_ON_LIBINTL /* avoid collision with intl/printf.c */
int
printf (const char *format, ...)
{
@@ -75,6 +76,7 @@ printf (const char *format, ...)
return retval;
}
+# endif
# endif
# if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
@@ -92,7 +94,7 @@ fprintf (FILE *stream, const char *format, ...)
}
# endif
-# if !REPLACE_VFPRINTF_POSIX /* avoid collision with vprintf.c */
+# if !REPLACE_VPRINTF_POSIX /* avoid collision with vprintf.c */
int
vprintf (const char *format, va_list args)
{
@@ -100,7 +102,7 @@ vprintf (const char *format, va_list args)
}
# endif
-# if !REPLACE_VPRINTF_POSIX /* avoid collision with vfprintf.c */
+# if !REPLACE_VFPRINTF_POSIX /* avoid collision with vfprintf.c */
int
vfprintf (FILE *stream, const char *format, va_list args)
#undef vfprintf
diff --git a/maint.mk b/maint.mk
index 2df7c04673..a4ce064924 100644
--- a/maint.mk
+++ b/maint.mk
@@ -772,11 +772,15 @@ INDENT_SOURCES ?= $(C_SOURCES)
indent:
indent $(INDENT_SOURCES)
+# If you have an additional project-specific rule,
+# define it in cfg.mk and set this variable to its name.
+update-copyright-local ?=
+
# Run this rule once per year (usually early in January)
# to update all FSF copyright year lists in your project.
update-copyright-exclude-regexp ?= (^|/)COPYING$$
.PHONY: update-copyright
-update-copyright:
+update-copyright: $(update-copyright-local)
grep -l -w Copyright $$($(VC_LIST_EXCEPT)) \
| grep -v -E '$(update-copyright-exclude-regexp)' \
| xargs $(build_aux)/$@