+/* Enable system fnmatch only on systems where fnmatch.h is usable.
+ If the fnmatch on your system is buggy, undef this symbol and a
+ replacement implementation will be used instead. */
+#ifdef HAVE_WORKING_FNMATCH_H
+# define SYSTEM_FNMATCH
+#endif
+
+#ifdef SYSTEM_FNMATCH
+# include <fnmatch.h>
+#else /* not SYSTEM_FNMATCH */
+/* Define fnmatch flags. Undef them first to avoid warnings in case
+ an evil library include chose to include system fnmatch.h. */
+# undef FNM_PATHNAME
+# undef FNM_NOESCAPE
+# undef FNM_PERIOD
+# undef FNM_NOMATCH
+
+# define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
+# define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
+# define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
+# define FNM_NOMATCH 1
+
+int fnmatch (const char *, const char *, int);
+#endif
+
+/* Provide sig_atomic_t if the system doesn't. */
+#ifndef HAVE_SIG_ATOMIC_T
+typedef int sig_atomic_t;
+#endif
+
+/* Provide uint32_t on the platforms that don't define it. Although
+ most code should be agnostic about integer sizes, some code really
+ does need a 32-bit integral type. Such code should use uint32_t.
+ (The exception is gnu-md5.[ch], which uses its own detection for
+ portability across platforms.) */
+
+#ifndef HAVE_UINT32_T
+# if SIZEOF_INT == 4
+typedef unsigned int uint32_t;
+# else
+# if SIZEOF_LONG == 4
+typedef unsigned long uint32_t;
+# else
+# if SIZEOF_SHORT == 4
+typedef unsigned short uint32_t;
+# else
+ #error "Cannot determine a 32-bit unsigned integer type"
+# endif
+# endif
+# endif
+#endif
+
+/* If uintptr_t isn't defined, simply typedef it to unsigned long. */
+#ifndef HAVE_UINTPTR_T
+typedef unsigned long uintptr_t;
+#endif
+
+/* If intptr_t isn't defined, simply typedef it to long. */
+#ifndef HAVE_INTPTR_T
+typedef long intptr_t;
+#endif
+