Add macro to define _GNU_SOURCE and _BSD_SOURCE and fix variable arguments.

Standards... Doh.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>