stats: Disable stats*.c on embedded targets

Change-Id: I6beb4fcc394ed7d3f8dd7a097b6e998245ecf401
diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h
index f754e41..09b836a 100644
--- a/include/osmocom/core/stats.h
+++ b/include/osmocom/core/stats.h
@@ -19,7 +19,15 @@
  */
 #pragma once
 
+/* a bit of a crude way to disable building/using this on (bare iron)
+ * embedded systems.  We cannot use the autoconf-defined HAVE_... macros
+ * here, as that only works at library compile time, not at application
+ * compile time */
+#ifdef unix
+
 #include <sys/socket.h>
+#include <arpa/inet.h>
+
 #include <osmocom/core/linuxlist.h>
 
 #include <stdint.h>
@@ -119,3 +127,5 @@
 int osmo_stats_reporter_send_buffer(struct osmo_stats_reporter *srep);
 int osmo_stats_reporter_udp_open(struct osmo_stats_reporter *srep);
 int osmo_stats_reporter_udp_close(struct osmo_stats_reporter *srep);
+
+#endif /* unix */