--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -664,7 +664,7 @@
 	return list;
 }
 
-#ifndef __GLIBC__
+#ifndef _GNU_SOURCE
 /* Good enough for our needs */
 static int
 strverscmp(const char *s1, const char *s2)
--- a/dhcpcd.h
+++ b/dhcpcd.h
@@ -28,6 +28,8 @@
 #ifndef DHCPCD_H
 #define DHCPCD_H
 
+#include <sys/types.h>
+
 extern char *dhcpcd_version;
 extern const char *dhcpcd_status;
 
