--- a/examples/example.c
+++ b/examples/example.c
@@ -29,8 +29,9 @@
  * Usage: 'example' or 'example <portname>'
  */
 
-#define _POSIX_SOURCE /* getaddrinfo() and friends. */
+#define _POSIX_C_SOURCE 1 /* getaddrinfo() and friends. */
 
+#include <features.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
