aboutsummaryrefslogtreecommitdiffstats
path: root/gl/size_max.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--gl/size_max.h (renamed from gl/asnprintf.c)38
1 files changed, 16 insertions, 22 deletions
diff --git a/gl/asnprintf.c b/gl/size_max.h
index 1b7f4ba39..ed0bc1377 100644
--- a/gl/asnprintf.c
+++ b/gl/size_max.h
@@ -1,5 +1,6 @@
-/* Formatted output to strings.
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+/* size_max.h -- declare SIZE_MAX through system headers
+ Copyright (C) 2005-2006 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
@@ -11,27 +12,20 @@
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,
+ 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. */
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#ifndef GNULIB_SIZE_MAX_H
+#define GNULIB_SIZE_MAX_H
-/* Specification. */
-#include "vasnprintf.h"
+/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */
+# include <limits.h>
+/* Get SIZE_MAX declaration on systems like glibc 2. */
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+/* On systems where these include files don't define it, SIZE_MAX is defined
+ in config.h. */
-#include <stdarg.h>
-
-char *
-asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
-{
- va_list args;
- char *result;
-
- va_start (args, format);
- result = vasnprintf (resultbuf, lengthp, format, args);
- va_end (args);
- return result;
-}
+#endif /* GNULIB_SIZE_MAX_H */