Procházet zdrojové kódy

enable -std=gnu11 for lua dir

devsaurus před 8 roky
rodič
revize
f149b60c7f

+ 6 - 0
app/include/driver/readline.h

@@ -0,0 +1,6 @@
+#ifndef READLINE_APP_H
+#define READLINE_APP_H
+
+bool uart_getc(char *c);
+
+#endif /* READLINE_APP_H */

+ 5 - 0
app/include/rom.h

@@ -122,6 +122,7 @@ char *ets_strcpy (char *dst, const char *src);
 size_t ets_strlen (const char *s);
 int ets_strcmp (const char *s1, const char *s2);
 int ets_strncmp (const char *s1, const char *s2, size_t n);
+char *ets_strncpy(char *dest, const char *src, size_t n);
 char *ets_strstr(const char *haystack, const char *needle);
 
 void ets_delay_us (uint32_t us);
@@ -142,6 +143,10 @@ void ets_intr_lock(void);
 void ets_intr_unlock(void);
 
 void ets_install_putc1(void *routine);
+
+int rand(void);
+void srand(unsigned int);
+
 void uart_div_modify(int no, unsigned int freq);
 
 #endif

+ 2 - 0
app/libc/c_stdlib.h

@@ -10,6 +10,8 @@
 #include "c_stddef.h"
 #include "mem.h"
 
+#include <stdlib.h>
+
 #define EXIT_FAILURE 1
 #define EXIT_SUCCESS 0
 

+ 2 - 0
app/lua/Makefile

@@ -15,6 +15,8 @@ ifndef PDIR
 GEN_LIBS = liblua.a
 endif
 
+STD_CFLAGS=-std=gnu11 -Wimplicit
+
 #############################################################
 # Configuration i.e. compile options etc.
 # Target specific stuff (defines etc.) goes in here!

+ 2 - 0
app/lua/lua.c

@@ -11,6 +11,8 @@
 #include "c_string.h"
 #include "flash_fs.h"
 #include "user_version.h"
+#include "driver/readline.h"
+#include "driver/uart.h"
 
 #define lua_c
 

+ 1 - 0
app/lua/lua.h

@@ -19,6 +19,7 @@
 #include "c_stdarg.h"
 #include "c_stddef.h"
 #include "c_types.h"
+#include <ctype.h>
 #endif
 
 #include "luaconf.h"

+ 1 - 1
app/lua/luaconf.h

@@ -632,7 +632,7 @@ extern int readline4lua(const char *prompt, char *buffer, int length);
 /*
 @@ The luai_num* macros define the primitive operations over numbers.
 */
-#if defined(LUA_CORE)
+#if defined(LUA_CORE) || defined(LUA_LIB)
 #ifdef LUA_CROSS_COMPILER
 #include <math.h>
 #else