# MUSL needs _GNU_SOURCE defined to work with gethostbyname()
# see bug# 896424
diff --git a/src/gtk-rig-ctrl.c b/src/gtk-rig-ctrl.c
index 288fa42..25de30c 100644
--- a/src/gtk-rig-ctrl.c
+++ b/src/gtk-rig-ctrl.c
@@ -34,6 +34,10 @@
 #include <build-config.h>
 #endif
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
 #include <gdk/gdkkeysyms.h>
 #include <glib.h>
 #include <glib/gi18n.h>
diff --git a/src/gtk-rot-ctrl.c b/src/gtk-rot-ctrl.c
index 5ff5d09..f9e3b4c 100644
--- a/src/gtk-rot-ctrl.c
+++ b/src/gtk-rot-ctrl.c
@@ -32,6 +32,10 @@
 #include <build-config.h>
 #endif
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
 /* NETWORK */
 #ifndef WIN32
 #include <arpa/inet.h>          /* htons() */
