- size_t len = strlen (str) + 1;
- char *res = malloc (len);
- if (res) memcpy (res, str, len);
- return res;
-}
+ long long quot; /* Quotient. */
+ long long rem; /* Remainder. */
+} lldiv_t;
+#endif
+
+#if !defined(HAVE_GETENV) || \
+ !defined(HAVE_USELOCALE)
+# include <stddef.h> /* NULL */
+#endif
+
+#if !defined (HAVE_REWIND) || \
+ !defined (HAVE_GETDELIM)
+# include <stdio.h> /* FILE */
+#endif
+
+#if !defined (HAVE_STRLCPY) || \
+ !defined (HAVE_STRNDUP) || \
+ !defined (HAVE_STRNLEN) || \
+ !defined (HAVE_GETCWD)
+# include <stddef.h> /* size_t */
+#endif
+
+#ifndef HAVE_VASPRINTF
+# include <stdarg.h> /* va_list */
+#endif
+
+#if !defined (HAVE_GETDELIM) || \
+ !defined (HAVE_GETPID) || \
+ !defined (HAVE_SWAB)
+# include <sys/types.h> /* ssize_t, pid_t */
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef HAVE_STRDUP
+char *strdup (const char *);