summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-02-21 02:19:34 +0000
committerBruno Haible <bruno@clisp.org>2007-02-21 02:19:34 +0000
commit3f868c07b0cc903d1ace5d81cabe123d0607435e (patch)
tree3b8f76cb4157af0386c1e5261ec63af21d6edd5a
parentb2f3ab8c42ddb13cc57a15ac756527c3a2849bec (diff)
downloadgnulib-3f868c07b0cc903d1ace5d81cabe123d0607435e.tar.gz
snprintf.h is replaced with <stdio.h>.
-rw-r--r--ChangeLog9
-rw-r--r--lib/getaddrinfo.c4
-rw-r--r--lib/snprintf.c5
-rw-r--r--lib/snprintf.h29
-rw-r--r--m4/snprintf.m48
-rw-r--r--modules/snprintf5
6 files changed, 24 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index cb8c674965..25a74f3f84 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2007-02-20 Bruno Haible <bruno@clisp.org>
+ * modules/snprintf (Files): Remove lib/snprintf.h.
+ (Depends-on): Add stdio.
+ (configure.ac): Invoke gl_STDIO_MODULE_INDICATOR.
+ (Include): Use <stdio.h> instead of snprintf.h.
+ * m4/snprintf.m4 (gl_FUNC_SNPRINTF): Require gl_STDIO_H_DEFAULTS. Set
+ HAVE_DECL_SNPRINTF.
+ * lib/snprintf.c: Include <stdio.h> instead of snprintf.h.
+ * lib/getaddrinfo.c: Likewise.
+
* modules/stdio: New file.
* lib/stdio_.h: New file, incorporating snprintf.h and vsnprintf.h.
* lib/snprintf.h: Remove file.
diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c
index add56ba1bd..cc718bcf33 100644
--- a/lib/getaddrinfo.c
+++ b/lib/getaddrinfo.c
@@ -31,6 +31,9 @@
/* Get memcpy, strdup. */
#include <string.h>
+/* Get snprintf. */
+#include <stdio.h>
+
#include <stdbool.h>
#include "gettext.h"
@@ -38,7 +41,6 @@
#define N_(String) String
#include "inet_ntop.h"
-#include "snprintf.h"
/* BeOS has AF_INET, but not PF_INET. */
#ifndef PF_INET
diff --git a/lib/snprintf.c b/lib/snprintf.c
index db1ca9af1e..dbae815a55 100644
--- a/lib/snprintf.c
+++ b/lib/snprintf.c
@@ -1,5 +1,5 @@
/* Formatted output to strings.
- Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc.
Written by Simon Josefsson and Paul Eggert.
This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,8 @@
#include <config.h>
-#include "snprintf.h"
+/* Specification. */
+#include <stdio.h>
#include <errno.h>
#include <limits.h>
diff --git a/lib/snprintf.h b/lib/snprintf.h
deleted file mode 100644
index 5032b9e8f8..0000000000
--- a/lib/snprintf.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Formatted output to strings.
- Copyright (C) 2004 Free Software Foundation, Inc.
- Written by Simon Josefsson.
-
- 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
- the Free Software Foundation; either version 2, 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 General Public License for more details.
-
- You should have received a copy of the GNU 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. */
-
-#ifndef SNPRINTF_H
-#define SNPRINTF_H
-
-/* Get snprintf declaration, if available. */
-#include <stdio.h>
-
-#if defined HAVE_DECL_SNPRINTF && !HAVE_DECL_SNPRINTF
-int snprintf (char *str, size_t size, const char *format, ...);
-#endif
-
-#endif /* SNPRINTF_H */
diff --git a/m4/snprintf.m4 b/m4/snprintf.m4
index 432e037550..b6f9f672d2 100644
--- a/m4/snprintf.m4
+++ b/m4/snprintf.m4
@@ -1,13 +1,17 @@
-# snprintf.m4 serial 2
-dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# snprintf.m4 serial 3
+dnl Copyright (C) 2002, 2003, 2004, 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_SNPRINTF],
[
+ AC_REQUIRE([gl_STDIO_H_DEFAULTS])
AC_REPLACE_FUNCS(snprintf)
AC_CHECK_DECLS_ONCE(snprintf)
+ if test $ac_cv_have_decl_snprintf = no; then
+ HAVE_DECL_SNPRINTF=0
+ fi
gl_PREREQ_SNPRINTF
])
diff --git a/modules/snprintf b/modules/snprintf
index df606b7d9b..c43e6da0a5 100644
--- a/modules/snprintf
+++ b/modules/snprintf
@@ -2,20 +2,21 @@ Description:
snprintf() function: print formatted output to a fixed length string
Files:
-lib/snprintf.h
lib/snprintf.c
m4/snprintf.m4
Depends-on:
+stdio
vasnprintf
configure.ac:
gl_FUNC_SNPRINTF
+gl_STDIO_MODULE_INDICATOR([snprintf])
Makefile.am:
Include:
-"snprintf.h"
+<stdio.h>
License:
LGPL