Browse Source

sync random and socket pkg

Lyon 2 years ago
parent
commit
c9bcde45ec
2 changed files with 4 additions and 5 deletions
  1. 1 5
      package/mqtt/random.c
  2. 3 0
      package/socket/PikaPlatform_socket.h

+ 1 - 5
package/mqtt/random.c

@@ -11,14 +11,10 @@
 
 #include "random.h"
 #include <stdlib.h>
+#include "PikaObj.h"
 
-extern int pika_platform_thread_timer_now();
 static unsigned int last_seed = 1;
 
-int __attribute__((weak)) pika_platform_thread_timer_now() {
-    return 1;
-}
-
 static int do_random(unsigned int seed) {
     srand(seed);
     return rand();

+ 3 - 0
package/socket/PikaPlatform_socket.h

@@ -28,6 +28,9 @@ int pika_platform_cleanup_winsock();
 #include "lwip/netdb.h"
 #include "lwip/opt.h"
 #include "lwip/sys.h"
+#if !LWIP_DNS
+#error "lwip dns is not enabled, please enable it in lwipopts.h"
+#endif
 #else
 /*
     You need to create the pika_platform_socket.h for your platform.