Load our config first
Never define the _GNU_SOURCE macro
Our custom config should not be in the public header
Remove test for memmem. We have to use our own it is a gnu extension
fix osx build
define _BSD_SOURCE to get proper prototypes on linux
Copy memmem, strdup, and strndup from libiberty rather than writing our own (or copying from some other source)

Remove _BSD_SOURCE define
Rename functions copied from libiberty

Also added a comment explaining why we did this.
Use "%" PRIu64 instead of "%lu" for printf with uint64 values
Handle AI_V4MAPPED not existing on OpenBSD