From 8befcf08882e6b96acfb4b4f395ea4ab111358d5 Mon Sep 17 00:00:00 2001 From: devsaurus Date: Sat, 23 Jan 2016 22:36:35 +0100 Subject: [PATCH 1/4] enable -std=gnu11 for crypto dir --- app/crypto/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/crypto/Makefile b/app/crypto/Makefile index a3aef405..17f4f70b 100644 --- a/app/crypto/Makefile +++ b/app/crypto/Makefile @@ -15,6 +15,8 @@ ifndef PDIR GEN_LIBS = libcrypto.a endif +STD_CFLAGS=-std=gnu11 -Wimplicit + ############################################################# # Configuration i.e. compile options etc. # Target specific stuff (defines etc.) goes in here! From 19fda87e33fde5e525484b758db725a22d5423dd Mon Sep 17 00:00:00 2001 From: devsaurus Date: Sat, 23 Jan 2016 22:41:41 +0100 Subject: [PATCH 2/4] enable -std=gnu11 for http dir --- app/http/Makefile | 1 + app/include/rom.h | 1 + sdk-overrides/include/osapi.h | 1 + 3 files changed, 3 insertions(+) diff --git a/app/http/Makefile b/app/http/Makefile index 66c9a7d1..4de124dd 100644 --- a/app/http/Makefile +++ b/app/http/Makefile @@ -15,6 +15,7 @@ ifndef PDIR GEN_LIBS = libhttp.a endif +STD_CFLAGS=-std=gnu11 -Wimplicit ############################################################# # Configuration i.e. compile options etc. diff --git a/app/include/rom.h b/app/include/rom.h index ffed887e..175bfcab 100644 --- a/app/include/rom.h +++ b/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_strstr(const char *haystack, const char *needle); void ets_delay_us (uint32_t us); diff --git a/sdk-overrides/include/osapi.h b/sdk-overrides/include/osapi.h index 374fea83..0fe27242 100644 --- a/sdk-overrides/include/osapi.h +++ b/sdk-overrides/include/osapi.h @@ -4,6 +4,7 @@ #include "rom.h" void ets_timer_arm_new (ETSTimer *a, int b, int c, int isMstimer); +int atoi(const char *nptr); int os_printf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); int os_printf_plus(const char *format, ...) __attribute__ ((format (printf, 1, 2))); From b3b50646ef9ddee81c81252894f77c0b424b3c44 Mon Sep 17 00:00:00 2001 From: devsaurus Date: Sat, 23 Jan 2016 22:42:55 +0100 Subject: [PATCH 3/4] enable -std=gnu11 for mqtt dir --- app/mqtt/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/mqtt/Makefile b/app/mqtt/Makefile index 3fd35717..925cb5b7 100644 --- a/app/mqtt/Makefile +++ b/app/mqtt/Makefile @@ -15,6 +15,8 @@ ifndef PDIR GEN_LIBS = mqtt.a endif +STD_CFLAGS=-std=gnu11 -Wimplicit + ############################################################# # Configuration i.e. compile options etc. # Target specific stuff (defines etc.) goes in here! From f149b60c7f654f7621dba16b47328db9b36e23e9 Mon Sep 17 00:00:00 2001 From: devsaurus Date: Sun, 24 Jan 2016 00:01:39 +0100 Subject: [PATCH 4/4] enable -std=gnu11 for lua dir --- app/include/driver/readline.h | 6 ++++++ app/include/rom.h | 5 +++++ app/libc/c_stdlib.h | 2 ++ app/lua/Makefile | 2 ++ app/lua/lua.c | 2 ++ app/lua/lua.h | 1 + app/lua/luaconf.h | 2 +- 7 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 app/include/driver/readline.h diff --git a/app/include/driver/readline.h b/app/include/driver/readline.h new file mode 100644 index 00000000..ae92cfd1 --- /dev/null +++ b/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 */ diff --git a/app/include/rom.h b/app/include/rom.h index 175bfcab..409d2bbe 100644 --- a/app/include/rom.h +++ b/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 diff --git a/app/libc/c_stdlib.h b/app/libc/c_stdlib.h index f0a6f265..bb2836d5 100644 --- a/app/libc/c_stdlib.h +++ b/app/libc/c_stdlib.h @@ -10,6 +10,8 @@ #include "c_stddef.h" #include "mem.h" +#include + #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 diff --git a/app/lua/Makefile b/app/lua/Makefile index 93d1f67b..8367c3e1 100644 --- a/app/lua/Makefile +++ b/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! diff --git a/app/lua/lua.c b/app/lua/lua.c index c66f35ee..cc1c1b95 100644 --- a/app/lua/lua.c +++ b/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 diff --git a/app/lua/lua.h b/app/lua/lua.h index 6d3fd1a0..69fcc95b 100644 --- a/app/lua/lua.h +++ b/app/lua/lua.h @@ -19,6 +19,7 @@ #include "c_stdarg.h" #include "c_stddef.h" #include "c_types.h" +#include #endif #include "luaconf.h" diff --git a/app/lua/luaconf.h b/app/lua/luaconf.h index 33c97754..01c052a2 100644 --- a/app/lua/luaconf.h +++ b/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 #else