Fix compile on Linux.
[dhcpcd-ui] / src / libdhcpcd / libdhcpcd.h
index 6f955bcc418e1b72ad4e5abe2249bb9d3c9af3cc..323b9938d7127f3ff6b93e4409a92bceea9cc69d 100644 (file)
@@ -98,6 +98,10 @@ extern DHCPCD_WATCH *dhcpcd_watching;
 #define DHCPCD_SERVICE "name.marples.roy.dhcpcd"
 #define DHCPCD_PATH    "/name/marples/roy/dhcpcd"
 
+#ifdef __GLIBC__
+#  define strlcpy(dst, src, n) snprintf(dst, n, "%s", src)
+#endif
+
 bool dhcpcd_iter_get(DHCPCD_CONNECTION *, DHCPCD_MESSAGEITER *, int, void *);
 DHCPCD_MESSAGE * dhcpcd_send_reply(DHCPCD_CONNECTION *, DHCPCD_MESSAGE *);
 DHCPCD_MESSAGE * dhcpcd_message_reply(DHCPCD_CONNECTION *,
@@ -111,8 +115,6 @@ bool dhcpcd_dispatch_message(DHCPCD_CONNECTION *, DHCPCD_MESSAGE *);
 typedef void * DHCPCD_CONNECTION;
 #endif
 
-#define DHCPCD_CALLBACK void (*callback)(DHCPCD_CONNECTION *, void *, void *)
-
 DHCPCD_CONNECTION * dhcpcd_open(char **);
 bool dhcpcd_close(DHCPCD_CONNECTION *);
 const char * dhcpcd_error(DHCPCD_CONNECTION *);