-#if (SIZEOF_LONG != 4 && SIZEOF_LONG != 8)
- error This function works only on systems for which sizeof(long) is 4 or 8.
-/* The previous line would begin with `#error,' but some compilers can't
- handle that even when the condition is false. */
+#undef __ptr_t
+#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
+# define __ptr_t void *
+#else /* Not C++ or ANSI C. */
+# define __ptr_t char *
+#endif /* C++ or ANSI C. */
+
+#if defined (HAVE_STRING_H) || defined (_LIBC)
+# include <string.h>
+#endif
+
+#if defined (HAVE_LIMIT_H) || defined (_LIBC)
+# include <limit.h>
+#endif
+
+#define LONG_MAX_32_BITS 2147483647
+
+#ifndef LONG_MAX
+#define LONG_MAX LONG_MAX_32_BITS