Kaynağa Gözat

【修正】ntp 在一些环境下编译可能出错的问题。

Signed-off-by: armink <armink.ztl@gmail.com>
armink 6 yıl önce
ebeveyn
işleme
df35bf7a8e
1 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 4 4
      ntp/ntp.c

+ 4 - 4
ntp/ntp.c

@@ -28,19 +28,19 @@
 #include <sys/types.h>
 #include <rtdevice.h>
 
-#if defined(RT_USING_SAL)
+#if defined(RT_USING_SAL) && defined(RT_USING_NETDEV)
+#include <arpa/inet.h>
 #include <sys/socket.h>
 #include <netdb.h>
 #elif defined(RT_USING_LWIP)
+#include <lwip/inet.h>
 #include <lwip/sockets.h>
 #include <lwip/netdb.h>
 #endif /* RT_USING_SAL */
 
-#if defined(RT_USING_NETDEV) 
-#include <arpa/inet.h>
+#if defined(RT_USING_NETDEV)
 #include <netdev.h>
 #elif defined(RT_USING_LWIP)
-#include <lwip/inet.h>
 #include <lwip/netif.h>
 #endif /* RT_USING_NETDEV */