Include gmid.h as first header in every file, as it then includes config.h (that defines _GNU_SOURCE for instance). Fix also a warning about unsigned vs signed const char pointers in openssl.
clang doesn't seem to care.
It's correct, while my hacked valid_multibyte_utf8 would allow things that aren't technically UTF8.