diff --git a/Makefile b/Makefile index 7b9631a5..052908ff 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,9 @@ SDK_DIR := $(TOP_DIR)/$(SDK_REL_DIR) ESPTOOL_VER := 2.6 # Ensure that the Espresif SDK is searched before the tool-chain's SDK (if any) -CCFLAGS:= -I$(TOP_DIR)/sdk-overrides/include -I$(TOP_DIR)/app/include/lwip/app -I$(SDK_DIR)/include +# Also, prevent the SDK's c_types.h from being included from anywhere, by +# predefining its include-guard. +CCFLAGS:= -I$(TOP_DIR)/sdk-overrides/include -I$(TOP_DIR)/app/include/lwip/app -I$(SDK_DIR)/include -D_C_TYPES_H_ LDFLAGS:= -L$(SDK_DIR)/lib -L$(SDK_DIR)/ld $(LDFLAGS) ifdef DEBUG diff --git a/app/coap/coap_client.c b/app/coap/coap_client.c index 63caf074..ae50b7c8 100644 --- a/app/coap/coap_client.c +++ b/app/coap/coap_client.c @@ -1,5 +1,5 @@ #include "user_config.h" -#include "c_types.h" +#include #include "coap.h" #include "hash.h" diff --git a/app/coap/coap_io.h b/app/coap/coap_io.h index dd1b91c5..5126e6ca 100644 --- a/app/coap/coap_io.h +++ b/app/coap/coap_io.h @@ -5,7 +5,6 @@ extern "C" { #endif -#include "c_types.h" #include "lwip/ip_addr.h" #include "espconn.h" #include "pdu.h" diff --git a/app/coap/coap_server.c b/app/coap/coap_server.c index 55c171f9..48671b50 100644 --- a/app/coap/coap_server.c +++ b/app/coap/coap_server.c @@ -1,5 +1,6 @@ #include "user_config.h" -#include "c_types.h" +#include +#include #include #include "coap.h" diff --git a/app/coap/str.c b/app/coap/str.c index 1c882eed..2e519c46 100644 --- a/app/coap/str.c +++ b/app/coap/str.c @@ -7,7 +7,7 @@ */ #include -#include "c_types.h" +#include #include "str.h" diff --git a/app/crypto/digests.h b/app/crypto/digests.h index 93d802bb..bdd04210 100644 --- a/app/crypto/digests.h +++ b/app/crypto/digests.h @@ -1,12 +1,13 @@ #ifndef _CRYPTO_DIGESTS_H_ #define _CRYPTO_DIGESTS_H_ -#include +#include +#include typedef void (*create_ctx_fn)(void *ctx); typedef void (*update_ctx_fn)(void *ctx, const uint8_t *msg, int len); typedef void (*finalize_ctx_fn)(uint8_t *digest, void *ctx); -typedef sint32_t ( *read_fn )(int fd, void *ptr, size_t len); +typedef int32_t ( *read_fn )(int fd, void *ptr, size_t len); /** * Description of a message digest mechanism. diff --git a/app/crypto/mech.h b/app/crypto/mech.h index a5d90d6c..98eef3b4 100644 --- a/app/crypto/mech.h +++ b/app/crypto/mech.h @@ -1,7 +1,9 @@ #ifndef _MECH_H_ #define _MECH_H_ -#include "c_types.h" +#include +#include +#include typedef struct { diff --git a/app/crypto/sha2.h b/app/crypto/sha2.h index 7ec49634..a0fd187c 100644 --- a/app/crypto/sha2.h +++ b/app/crypto/sha2.h @@ -1,7 +1,8 @@ #ifndef __SHA2_H__ #define __SHA2_H__ -#include +#include +#include /************************************************************************** * SHA256/384/512 declarations diff --git a/app/dht/dht.h b/app/dht/dht.h index 7e80d5e0..8c78909c 100644 --- a/app/dht/dht.h +++ b/app/dht/dht.h @@ -17,7 +17,7 @@ // #else // #include // #endif -#include "c_types.h" +#include #define DHT_LIB_VERSION "0.1.14" @@ -67,4 +67,4 @@ double dht_getTemperature(void); #endif // // END OF FILE -// \ No newline at end of file +// diff --git a/app/driver/pwm2.c b/app/driver/pwm2.c index ad41307c..38da5c21 100644 --- a/app/driver/pwm2.c +++ b/app/driver/pwm2.c @@ -5,8 +5,8 @@ * Nikolay Fiykov */ -#include -#include "c_types.h" +#include +#include #include "mem.h" #include "pin_map.h" #include "platform.h" diff --git a/app/driver/readline.c b/app/driver/readline.c index c262064b..99192bbc 100644 --- a/app/driver/readline.c +++ b/app/driver/readline.c @@ -2,7 +2,7 @@ #include "os_type.h" #include "osapi.h" #include "driver/uart.h" -#include "c_types.h" +#include LOCAL os_timer_t readline_timer; diff --git a/app/driver/rotary.c b/app/driver/rotary.c index 6e01506e..c54bda55 100644 --- a/app/driver/rotary.c +++ b/app/driver/rotary.c @@ -11,7 +11,7 @@ */ #include "platform.h" -#include "c_types.h" +#include #include #include #include "driver/rotary.h" diff --git a/app/driver/switec.c b/app/driver/switec.c index 23c1a5f1..d776749a 100644 --- a/app/driver/switec.c +++ b/app/driver/switec.c @@ -14,7 +14,8 @@ */ #include "platform.h" -#include "c_types.h" +#include +#include #include #include #include "driver/switec.h" diff --git a/app/esp-gdbstub/gdbstub.c b/app/esp-gdbstub/gdbstub.c index 509e9bb4..ded8c537 100644 --- a/app/esp-gdbstub/gdbstub.c +++ b/app/esp-gdbstub/gdbstub.c @@ -10,7 +10,6 @@ #include "gdbstub.h" #include "ets_sys.h" #include "eagle_soc.h" -#include "c_types.h" #include "gpio.h" #include "xtensa/corebits.h" #include "driver/uart.h" diff --git a/app/include/arch/cc.h b/app/include/arch/cc.h index 2829bd98..6fbff3ef 100644 --- a/app/include/arch/cc.h +++ b/app/include/arch/cc.h @@ -35,7 +35,7 @@ #define __ARCH_CC_H__ //#include -#include "c_types.h" +#include #include "ets_sys.h" #include "osapi.h" #define EFAULT 14 diff --git a/app/include/driver/onewire.h b/app/include/driver/onewire.h index c52492e7..f8088252 100644 --- a/app/include/driver/onewire.h +++ b/app/include/driver/onewire.h @@ -1,7 +1,8 @@ #ifndef __ONEWIRE_H__ #define __ONEWIRE_H__ -#include "c_types.h" +#include +#include // You can exclude certain features from OneWire. In theory, this // might save some space. In practice, the compiler automatically diff --git a/app/include/driver/pwm2.h b/app/include/driver/pwm2.h index c0fad44f..1ca28463 100644 --- a/app/include/driver/pwm2.h +++ b/app/include/driver/pwm2.h @@ -8,7 +8,7 @@ #ifndef __PWM2_H__ #define __PWM2_H__ -#include "c_types.h" +#include #include "pin_map.h" typedef struct { diff --git a/app/include/driver/rotary.h b/app/include/driver/rotary.h index d4c3ec59..31215c74 100644 --- a/app/include/driver/rotary.h +++ b/app/include/driver/rotary.h @@ -4,7 +4,7 @@ #ifndef __ROTARY_H__ #define __ROTARY_H__ -#include "c_types.h" +#include #define ROTARY_CHANNEL_COUNT 3 diff --git a/app/include/driver/switec.h b/app/include/driver/switec.h index 2fd5b5c0..65b64fd4 100644 --- a/app/include/driver/switec.h +++ b/app/include/driver/switec.h @@ -4,7 +4,7 @@ #ifndef __SWITEC_H__ #define __SWITEC_H__ -#include "c_types.h" +#include #define SWITEC_CHANNEL_COUNT 3 diff --git a/app/include/driver/uart.h b/app/include/driver/uart.h index 76c04f8e..310f6054 100644 --- a/app/include/driver/uart.h +++ b/app/include/driver/uart.h @@ -3,7 +3,7 @@ #include "uart_register.h" #include "eagle_soc.h" -#include "c_types.h" +#include #include "os_type.h" #define RX_BUFF_SIZE 0x100 diff --git a/app/include/lwip/app/espconn_buf.h b/app/include/lwip/app/espconn_buf.h index 8bdfaa12..a7a10a68 100644 --- a/app/include/lwip/app/espconn_buf.h +++ b/app/include/lwip/app/espconn_buf.h @@ -14,7 +14,8 @@ * Created on: Apr 22, 2016 * Author: liuhan */ -#include "c_types.h" +#include +#include #include "ets_sys.h" #include "os_type.h" diff --git a/app/include/pm/pmSleep.h b/app/include/pm/pmSleep.h index 093c7dc5..2fb8f46c 100644 --- a/app/include/pm/pmSleep.h +++ b/app/include/pm/pmSleep.h @@ -1,7 +1,7 @@ #ifndef __FPM_SLEEP_H__ #define __FPM_SLEEP_H__ #include "user_interface.h" -#include "c_types.h" +#include #include "lauxlib.h" #include "gpio.h" #include "platform.h" diff --git a/app/include/rom.h b/app/include/rom.h index f64d50a0..3548f28a 100644 --- a/app/include/rom.h +++ b/app/include/rom.h @@ -3,7 +3,7 @@ #ifndef _ROM_H_ #define _ROM_H_ -#include "c_types.h" +#include #include "ets_sys.h" // SHA1 is assumed to match the netbsd sha1.h headers diff --git a/app/include/rtc/rtcaccess.h b/app/include/rtc/rtcaccess.h index 4d27cb6f..92f81f5c 100644 --- a/app/include/rtc/rtcaccess.h +++ b/app/include/rtc/rtcaccess.h @@ -1,7 +1,7 @@ #ifndef RTC_ACCESS_H #define RTC_ACCESS_H -#include +#include #define RTC_MMIO_BASE 0x60000700 #define RTC_USER_MEM_BASE 0x60001200 diff --git a/app/include/rtc/rtctime.h b/app/include/rtc/rtctime.h index 81bf8f67..5cb7b83d 100644 --- a/app/include/rtc/rtctime.h +++ b/app/include/rtc/rtctime.h @@ -38,7 +38,7 @@ * relevant functions and expose these instead, through the rtctime.c module. */ -#include +#include #include "sections.h" #ifndef _RTCTIME_INTERNAL_H_ diff --git a/app/include/user_mbedtls.h b/app/include/user_mbedtls.h index cb3b7923..dcfe4c8e 100644 --- a/app/include/user_mbedtls.h +++ b/app/include/user_mbedtls.h @@ -1,4 +1,5 @@ -#include "c_types.h" +#include +#include #include "user_config.h" diff --git a/app/libc/stdlib.c b/app/libc/stdlib.c index 6299eceb..08fbda0b 100644 --- a/app/libc/stdlib.c +++ b/app/libc/stdlib.c @@ -3,6 +3,7 @@ #include #include #include +#include #ifdef LUA_CROSS_COMPILER #define ICACHE_RODATA_ATTR diff --git a/app/lua/legc.c b/app/lua/legc.c index 8b13b26f..c0bf07a6 100644 --- a/app/lua/legc.c +++ b/app/lua/legc.c @@ -2,7 +2,6 @@ #include "legc.h" #include "lstate.h" -#include "c_types.h" void legc_set_mode(lua_State *L, int mode, int limit) { global_State *g = G(L); diff --git a/app/lua/luac_cross.h b/app/lua/luac_cross.h index f4a4da83..716a743b 100644 --- a/app/lua/luac_cross.h +++ b/app/lua/luac_cross.h @@ -6,73 +6,14 @@ #define luac_cross_h #ifdef LUA_CROSS_COMPILER - -#define C_HEADER_ASSERT -#define C_HEADER_CTYPE -#define C_HEADER_ERRNO -#define C_HEADER_FCNTL -#define C_HEADER_LOCALE -#define C_HEADER_MATH -#define C_HEADER_STDIO -#define C_HEADER_STDLIB -#define C_HEADER_STRING -#define C_HEADER_TIME - #define ICACHE_RODATA_ATTR -#define c_abs abs -#define c_exit exit -#define c_fclose fclose -#define c_feof feof -#define c_ferror ferror -#define c_fopen fopen -#define c_fread fread -#define c_free free -#define c_freopen freopen -#define c_getc getc -#define c_getenv getenv -#define c_malloc malloc -#define c_memcmp memcmp -#define c_memcpy memcpy -#define c_printf printf -#define c_puts puts -#define c_reader reader -#define c_realloc realloc -#define c_sprintf sprintf #define c_stderr stderr #define c_stdin stdin #define c_stdout stdout -#define c_strcat strcat -#define c_strchr strchr -#define c_strcmp strcmp -#define c_strcoll strcoll -#define c_strcpy strcpy -#define c_strcspn strcspn -#define c_strerror strerror -#define c_strlen strlen -#define c_strncat strncat -#define c_strncmp strncmp -#define c_strncpy strncpy -#define c_strpbrk strpbrk -#define c_strrchr strrchr -#define c_strstr strstr -double c_strtod(const char *__n, char **__end_PTR); -#define c_ungetc ungetc -#define c_strtol strtol -#define c_strtoul strtoul + #define dbg_printf printf #else -#define C_HEADER_ASSERT "c_assert.h" -#define C_HEADER_CTYPE "c_ctype.h" -#define C_HEADER_ERRNO "c_errno.h" -#define C_HEADER_FCNTL "c_fcntl.h" -#define C_HEADER_LOCALE "c_locale.h" -#define C_HEADER_MATH "c_math.h" -#define C_HEADER_STDIO "c_stdio.h" -#define C_HEADER_STDLIB "c_stdlib.h" -#define C_HEADER_STRING "c_string.h" -#define C_HEADER_TIME "c_time.h" - #endif /* LUA_CROSS_COMPILER */ #endif /* luac_cross_h */ diff --git a/app/lua/luac_cross/lflashimg.c b/app/lua/luac_cross/lflashimg.c index 4dd5a853..7ded81fd 100644 --- a/app/lua/luac_cross/lflashimg.c +++ b/app/lua/luac_cross/lflashimg.c @@ -7,10 +7,10 @@ #define LUAC_CROSS_FILE #include "luac_cross.h" -#include C_HEADER_CTYPE -#include C_HEADER_STDIO -#include C_HEADER_STDLIB -#include C_HEADER_STRING +#include +#include +#include +#include #define lflashimg_c #define LUA_CORE diff --git a/app/lua/luac_cross/loslib.c b/app/lua/luac_cross/loslib.c index 59c22794..604ea793 100644 --- a/app/lua/luac_cross/loslib.c +++ b/app/lua/luac_cross/loslib.c @@ -7,11 +7,11 @@ #define LUAC_CROSS_FILE #include "luac_cross.h" -#include C_HEADER_ERRNO -#include C_HEADER_LOCALE -#include C_HEADER_STDLIB -#include C_HEADER_STRING -#include C_HEADER_TIME +#include +#include +#include +#include +#include #define loslib_c #define LUA_LIB @@ -217,7 +217,7 @@ static int os_setlocale (lua_State *L) { static int os_exit (lua_State *L) { - c_exit(luaL_optint(L, 1, EXIT_SUCCESS)); + exit(luaL_optint(L, 1, EXIT_SUCCESS)); } LROT_PUBLIC_BEGIN(oslib) diff --git a/app/lua/luac_cross/luac.c b/app/lua/luac_cross/luac.c index 7853604a..2cb62ee3 100644 --- a/app/lua/luac_cross/luac.c +++ b/app/lua/luac_cross/luac.c @@ -7,10 +7,10 @@ #define LUAC_CROSS_FILE #include "luac_cross.h" -#include C_HEADER_ERRNO -#include C_HEADER_STDIO -#include C_HEADER_STDLIB -#include C_HEADER_STRING +#include +#include +#include +#include #include #define luac_c diff --git a/app/lua/luac_cross/print.c b/app/lua/luac_cross/print.c index 1273d47e..71b8352a 100644 --- a/app/lua/luac_cross/print.c +++ b/app/lua/luac_cross/print.c @@ -7,8 +7,8 @@ #define LUAC_CROSS_FILE #include "luac_cross.h" -#include C_HEADER_CTYPE -#include C_HEADER_STDIO +#include +#include #define luac_c #define LUA_CORE diff --git a/app/lwip/core/sys_arch.c b/app/lwip/core/sys_arch.c index 81bb2208..7dd953ba 100644 --- a/app/lwip/core/sys_arch.c +++ b/app/lwip/core/sys_arch.c @@ -2,7 +2,7 @@ * copyright (c) 2010 - 2011 espressif system */ -#include "c_types.h" +#include #include "ets_sys.h" #include "osapi.h" #include "os_type.h" diff --git a/app/mbedtls/app/Espconn_mem.c b/app/mbedtls/app/Espconn_mem.c index 41b1dd92..5620b1b9 100644 --- a/app/mbedtls/app/Espconn_mem.c +++ b/app/mbedtls/app/Espconn_mem.c @@ -1,4 +1,4 @@ -#include "c_types.h" +#include #include "mem.h" #include "user_interface.h" diff --git a/app/mbedtls/app/lwIPFile.c b/app/mbedtls/app/lwIPFile.c index bdae8fd1..b9fadd22 100644 --- a/app/mbedtls/app/lwIPFile.c +++ b/app/mbedtls/app/lwIPFile.c @@ -22,7 +22,7 @@ * */ -#include "c_types.h" +#include #include //#include "os.h" diff --git a/app/modules/adc.c b/app/modules/adc.c index 2d9777ca..5b87e97f 100644 --- a/app/modules/adc.c +++ b/app/modules/adc.c @@ -4,7 +4,7 @@ #include "lauxlib.h" #include "platform.h" -#include "c_types.h" +#include #include "user_interface.h" // Lua: read(id) , return system adc diff --git a/app/modules/bloom.c b/app/modules/bloom.c index 922e3ed2..5198c120 100644 --- a/app/modules/bloom.c +++ b/app/modules/bloom.c @@ -7,7 +7,7 @@ #include "module.h" #include "lauxlib.h" #include -#include "c_types.h" +#include #include "../crypto/sha2.h" #if defined(LUA_USE_MODULES_BLOOM) && !defined(SHA2_ENABLE) diff --git a/app/modules/coap.c b/app/modules/coap.c index f810154e..a50a086f 100644 --- a/app/modules/coap.c +++ b/app/modules/coap.c @@ -5,9 +5,9 @@ #include "platform.h" #include -#include +#include -#include "c_types.h" +#include #include "mem.h" #include "lwip/ip_addr.h" #include "espconn.h" diff --git a/app/modules/cron.c b/app/modules/cron.c index 5196c003..d39a2754 100644 --- a/app/modules/cron.c +++ b/app/modules/cron.c @@ -4,12 +4,12 @@ #include "lauxlib.h" #include "lmem.h" #include "user_interface.h" -#include "c_types.h" +#include +#include #include #include "ets_sys.h" #include "time.h" #include "rtc/rtctime.h" -#include "stdlib.h" #include "mem.h" struct cronent_desc { diff --git a/app/modules/crypto.c b/app/modules/crypto.c index f55b7f2e..3deabdaa 100644 --- a/app/modules/crypto.c +++ b/app/modules/crypto.c @@ -4,8 +4,8 @@ #include "module.h" #include "lauxlib.h" #include "platform.h" -#include "c_types.h" -#include +#include +#include #include "vfs.h" #include "../crypto/digests.h" #include "../crypto/mech.h" diff --git a/app/modules/file.c b/app/modules/file.c index 03763b74..34ff3ed4 100644 --- a/app/modules/file.c +++ b/app/modules/file.c @@ -5,7 +5,7 @@ #include "lmem.h" #include "platform.h" -#include "c_types.h" +#include #include "vfs.h" #include diff --git a/app/modules/gdbstub.c b/app/modules/gdbstub.c index 9ba6922c..a76d97b0 100644 --- a/app/modules/gdbstub.c +++ b/app/modules/gdbstub.c @@ -17,7 +17,7 @@ #include "module.h" #include "lauxlib.h" #include "platform.h" -#include "c_types.h" +#include #include "user_interface.h" #include "../esp-gdbstub/gdbstub.h" diff --git a/app/modules/gpio.c b/app/modules/gpio.c index 43104413..939d3d25 100644 --- a/app/modules/gpio.c +++ b/app/modules/gpio.c @@ -6,7 +6,7 @@ #include "lmem.h" #include "platform.h" #include "user_interface.h" -#include "c_types.h" +#include #include #include "gpio.h" #include "hw_timer.h" diff --git a/app/modules/gpio_pulse.c b/app/modules/gpio_pulse.c index 35945862..15909572 100644 --- a/app/modules/gpio_pulse.c +++ b/app/modules/gpio_pulse.c @@ -3,7 +3,7 @@ #include "lmem.h" #include "platform.h" #include "user_interface.h" -#include "c_types.h" +#include #include #include "gpio.h" #include "hw_timer.h" diff --git a/app/modules/mdns.c b/app/modules/mdns.c index 8694c045..a574f375 100644 --- a/app/modules/mdns.c +++ b/app/modules/mdns.c @@ -7,7 +7,7 @@ #include #include -#include "c_types.h" +#include #include "lwip/ip_addr.h" #include "nodemcu_mdns.h" #include "user_interface.h" diff --git a/app/modules/mqtt.c b/app/modules/mqtt.c index 49ae3e5b..dcb25005 100644 --- a/app/modules/mqtt.c +++ b/app/modules/mqtt.c @@ -5,9 +5,9 @@ #include "platform.h" #include -#include +#include -#include "c_types.h" +#include #include "mem.h" #include "lwip/ip_addr.h" #include "espconn.h" diff --git a/app/modules/net.c b/app/modules/net.c index d0b705d7..fdbd575d 100644 --- a/app/modules/net.c +++ b/app/modules/net.c @@ -7,9 +7,9 @@ #include #include -#include +#include -#include "c_types.h" +#include #include "mem.h" #include "osapi.h" #include "lwip/err.h" diff --git a/app/modules/node.c b/app/modules/node.c index cc834c31..a44f3fa4 100644 --- a/app/modules/node.c +++ b/app/modules/node.c @@ -16,7 +16,7 @@ #include "platform.h" #include "lflash.h" -#include "c_types.h" +#include #include #include "driver/uart.h" #include "user_interface.h" diff --git a/app/modules/pwm.c b/app/modules/pwm.c index 8296e433..c7d83568 100644 --- a/app/modules/pwm.c +++ b/app/modules/pwm.c @@ -3,7 +3,7 @@ #include "module.h" #include "lauxlib.h" #include "platform.h" -#include "c_types.h" +#include // Lua: realfrequency = setup( id, frequency, duty ) static int lpwm_setup( lua_State* L ) diff --git a/app/modules/pwm2.c b/app/modules/pwm2.c index 027b4019..4ee31672 100644 --- a/app/modules/pwm2.c +++ b/app/modules/pwm2.c @@ -7,7 +7,7 @@ // Module for interfacing with PWM2 driver -#include "c_types.h" +#include #include "lauxlib.h" #include "module.h" #include "driver/pwm2.h" diff --git a/app/modules/rotary.c b/app/modules/rotary.c index 27df5440..44397ef7 100644 --- a/app/modules/rotary.c +++ b/app/modules/rotary.c @@ -9,10 +9,10 @@ #include "module.h" #include "lauxlib.h" #include "platform.h" -#include "c_types.h" +#include +#include #include "user_interface.h" #include "driver/rotary.h" -#include #define MASK(x) (1 << ROTARY_ ## x ## _INDEX) diff --git a/app/modules/somfy.c b/app/modules/somfy.c index c8ae5d7e..79abf50e 100644 --- a/app/modules/somfy.c +++ b/app/modules/somfy.c @@ -11,6 +11,7 @@ //#define NODE_DEBUG +#include #include "os_type.h" #include "osapi.h" #include "sections.h" @@ -245,4 +246,4 @@ int luaopen_somfy( lua_State *L ) { return 0; } -NODEMCU_MODULE(SOMFY, "somfy", somfy, luaopen_somfy); \ No newline at end of file +NODEMCU_MODULE(SOMFY, "somfy", somfy, luaopen_somfy); diff --git a/app/modules/sqlite3.c b/app/modules/sqlite3.c index a6b9cde6..c8422498 100644 --- a/app/modules/sqlite3.c +++ b/app/modules/sqlite3.c @@ -30,7 +30,7 @@ #define LSQLITE_OMIT_UPDATE_HOOK 1 #define SQLITE_OMIT_PROGRESS_CALLBACK 1 -#include +#include #include #include diff --git a/app/modules/switec.c b/app/modules/switec.c index a954b892..08b69898 100644 --- a/app/modules/switec.c +++ b/app/modules/switec.c @@ -16,7 +16,7 @@ #include "module.h" #include "lauxlib.h" #include "platform.h" -#include "c_types.h" +#include #include "task/task.h" #include "driver/switec.h" diff --git a/app/modules/tls.c b/app/modules/tls.c index d59af574..b9a63f62 100644 --- a/app/modules/tls.c +++ b/app/modules/tls.c @@ -9,9 +9,9 @@ #include "lmem.h" #include -#include +#include -#include "c_types.h" +#include #include "mem.h" #include "lwip/ip_addr.h" #include "espconn.h" diff --git a/app/modules/tmr.c b/app/modules/tmr.c index 14b7f528..10c09db3 100644 --- a/app/modules/tmr.c +++ b/app/modules/tmr.c @@ -51,7 +51,7 @@ tmr.softwd(int) #include "module.h" #include "lauxlib.h" #include "platform.h" -#include "c_types.h" +#include #include "user_interface.h" #include "pm/swtimer.h" diff --git a/app/modules/uart.c b/app/modules/uart.c index 364873d7..5dcba1c4 100644 --- a/app/modules/uart.c +++ b/app/modules/uart.c @@ -4,7 +4,7 @@ #include "lauxlib.h" #include "platform.h" -#include "c_types.h" +#include #include #include "rom.h" diff --git a/app/modules/websocket.c b/app/modules/websocket.c index 77d83d08..71ecd67a 100644 --- a/app/modules/websocket.c +++ b/app/modules/websocket.c @@ -13,9 +13,9 @@ #include "platform.h" #include "module.h" -#include "c_types.h" +#include #include -#include +#include #include "websocketclient.h" diff --git a/app/modules/wifi.c b/app/modules/wifi.c index ddcc3096..6e5b6d02 100644 --- a/app/modules/wifi.c +++ b/app/modules/wifi.c @@ -7,10 +7,10 @@ #include "platform.h" #include -#include +#include #include "ctype.h" -#include "c_types.h" +#include #include "user_interface.h" #include "wifi_common.h" diff --git a/app/modules/wifi_eventmon.c b/app/modules/wifi_eventmon.c index 5d016f91..f5d87170 100644 --- a/app/modules/wifi_eventmon.c +++ b/app/modules/wifi_eventmon.c @@ -5,9 +5,9 @@ #include "platform.h" #include -#include +#include -#include "c_types.h" +#include #include "user_interface.h" #include "smart.h" #include "smartconfig.h" diff --git a/app/modules/wifi_monitor.c b/app/modules/wifi_monitor.c index 041bb03f..951f5be4 100644 --- a/app/modules/wifi_monitor.c +++ b/app/modules/wifi_monitor.c @@ -6,10 +6,10 @@ #include "platform.h" #include -#include +#include #include "ctype.h" -#include "c_types.h" +#include #include "user_interface.h" #include "wifi_common.h" #include "sys/network_80211.h" diff --git a/app/mqtt/mqtt_msg.h b/app/mqtt/mqtt_msg.h index 57d07158..85f70f6d 100644 --- a/app/mqtt/mqtt_msg.h +++ b/app/mqtt/mqtt_msg.h @@ -7,7 +7,7 @@ #ifndef MQTT_MSG_H #define MQTT_MSG_H -#include "c_types.h" +#include #ifdef __cplusplus extern "C" { #endif diff --git a/app/platform/cpu_esp8266.h b/app/platform/cpu_esp8266.h index 7ff7b6cf..4d82b684 100644 --- a/app/platform/cpu_esp8266.h +++ b/app/platform/cpu_esp8266.h @@ -2,6 +2,9 @@ #define __CPU_ESP8266_H__ #ifndef NO_CPU_ESP8266_INCLUDE +#include +#include +#include #include "os_type.h" #include "spi_flash.h" #include "pin_map.h" diff --git a/app/platform/pin_map.h b/app/platform/pin_map.h index a4d3fe93..4ad1b7c9 100644 --- a/app/platform/pin_map.h +++ b/app/platform/pin_map.h @@ -2,7 +2,7 @@ #ifndef __PIN_MAP_H__ #define __PIN_MAP_H__ -#include "c_types.h" +#include #include "user_config.h" #include "gpio.h" diff --git a/app/platform/platform.h b/app/platform/platform.h index 4350b5f4..3a41ddfc 100644 --- a/app/platform/platform.h +++ b/app/platform/platform.h @@ -3,9 +3,9 @@ #ifndef __PLATFORM_H__ #define __PLATFORM_H__ +#include #include "cpu_esp8266.h" -#include "c_types.h" #include "driver/pwm.h" #include "driver/uart.h" #include "task/task.h" diff --git a/app/platform/sdcard.c b/app/platform/sdcard.c index 1a2f6535..143d96c8 100644 --- a/app/platform/sdcard.c +++ b/app/platform/sdcard.c @@ -1,6 +1,6 @@ #include "platform.h" #include "driver/spi.h" -#include "c_types.h" +#include #include "sdcard.h" diff --git a/app/platform/sdcard.h b/app/platform/sdcard.h index a408b4c1..f6bb4133 100644 --- a/app/platform/sdcard.h +++ b/app/platform/sdcard.h @@ -1,7 +1,8 @@ #ifndef _SDCARD_H #define _SDCARD_H -#include "c_types.h" +#include +#include int platform_sdcard_init( uint8_t spi_no, uint8_t ss_pin ); int platform_sdcard_status( void ); diff --git a/app/pm/swtimer.c b/app/pm/swtimer.c index 0e89a3fd..5e0bb38b 100644 --- a/app/pm/swtimer.c +++ b/app/pm/swtimer.c @@ -48,8 +48,8 @@ #include #include #include - -#include "c_types.h" +#include +#include //#define SWTMR_DEBUG #if !defined(SWTMR_DBG) && defined(LUA_USE_MODULES_SWTMR_DBG) diff --git a/app/sjson/memcompat.h b/app/sjson/memcompat.h index 7112e201..d6fba37b 100644 --- a/app/sjson/memcompat.h +++ b/app/sjson/memcompat.h @@ -1,7 +1,7 @@ #ifndef __MEMCOMPAT_H__ #define __MEMCOMPAT_H__ -#include "c_types.h" +#include #include "mem.h" #endif diff --git a/app/sqlite3/esp8266.c b/app/sqlite3/esp8266.c index 1cd8f1da..c058e495 100644 --- a/app/sqlite3/esp8266.c +++ b/app/sqlite3/esp8266.c @@ -8,9 +8,9 @@ **/ #include -#include +#include #include -#include "c_types.h" +#include #include #include #include diff --git a/app/sqlite3/sqlite3.c b/app/sqlite3/sqlite3.c index 8cfe9305..58431181 100644 --- a/app/sqlite3/sqlite3.c +++ b/app/sqlite3/sqlite3.c @@ -2795,7 +2795,7 @@ SQLITE_API void sqlite3_free_table(char **result); ** table and column names into a constructed SQL statement. ** ** ^(The "%z" formatting option works like "%s" but with the -** addition that after the c_string has been read and copied into +** addition that after the string has been read and copied into ** the result, [sqlite3_free()] is called on the input string.)^ */ SQLITE_API char *sqlite3_mprintf(const char*,...); @@ -29771,7 +29771,7 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){ /* ** standard include files. */ -#include +#include #include #include #include @@ -78053,7 +78053,7 @@ static int findNextHostParameter(const char *zSql, int *pnToken){ ** obtained from sqlite3DbMalloc(). If sqlite3.nVdbeExec is 1, then the ** string contains a copy of zRawSql but with host parameters expanded to ** their current bindings. Or, if sqlite3.nVdbeExec is greater than 1, -** then the returned c_string holds a copy of zRawSql with "-- " prepended +** then the returned string holds a copy of zRawSql with "-- " prepended ** to each line of text. ** ** If the SQLITE_TRACE_SIZE_LIMIT macro is defined to an integer, then @@ -89198,8 +89198,8 @@ SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *pVfs){ ** an SQL statement. */ /* #include "sqliteInt.h" */ -/* #include */ -/* #include */ +/* #include */ +/* #include */ /* @@ -105553,7 +105553,7 @@ SQLITE_PRIVATE void sqlite3ResolvePartIdxLabel(Parse *pParse, int iLabel){ ** time functions, are implemented separately.) */ /* #include "sqliteInt.h" */ -/* #include */ +/* #include */ /* #include */ /* #include "vdbeInt.h" */ @@ -108885,7 +108885,7 @@ SQLITE_PRIVATE void sqlite3OpenTable( /* ** Return a pointer to the column affinity string associated with index -** pIdx. A column affinity c_string has one character for each column in +** pIdx. A column affinity string has one character for each column in ** the table, according to the affinity of the column: ** ** Character Column affinity @@ -108951,7 +108951,7 @@ SQLITE_PRIVATE const char *sqlite3IndexAffinityStr(sqlite3 *db, Index *pIdx){ ** then just set the P4 operand of the previous opcode (which should be ** an OP_MakeRecord) to the affinity string. ** -** A column affinity c_string has one character per column: +** A column affinity string has one character per column: ** ** Character Column affinity ** ------------------------------ @@ -135437,7 +135437,7 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){ ** The following is the concatenation of all %include directives from the ** input grammar file: */ -/* #include */ +/* #include */ /************ Begin %include sections from the grammar ************************/ /* #include "sqliteInt.h" */ @@ -136309,7 +136309,7 @@ struct yyParser { typedef struct yyParser yyParser; #ifndef NDEBUG -/* #include */ +/* #include */ static FILE *yyTraceFILE = 0; static char *yyTracePrompt = 0; #endif /* NDEBUG */ @@ -138629,7 +138629,7 @@ SQLITE_PRIVATE void sqlite3Parser( ** parser for analysis. */ /* #include "sqliteInt.h" */ -/* #include */ +/* #include */ /* Character classes for tokenizing ** @@ -145471,10 +145471,10 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeIsdiacritic(int); #endif /* #include */ -/* #include */ +/* #include */ /* #include */ -/* #include */ -/* #include */ +/* #include */ +/* #include */ /* #include */ /* #include "fts3.h" */ @@ -151141,7 +151141,7 @@ SQLITE_API int sqlite3_fts3_init( /* #include "fts3Int.h" */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) -/* #include */ +/* #include */ /* #include */ typedef struct Fts3auxTable Fts3auxTable; @@ -151758,7 +151758,7 @@ SQLITE_API int sqlite3_fts3_enable_parentheses = 0; */ #define SQLITE_FTS3_DEFAULT_NEAR_PARAM 10 -/* #include */ +/* #include */ /* #include */ /* @@ -152786,7 +152786,7 @@ SQLITE_PRIVATE void sqlite3Fts3ExprFree(Fts3Expr *pDel){ #ifdef SQLITE_TEST -/* #include */ +/* #include */ /* ** Function to query the hash-table of tokenizers (see README.tokenizers). @@ -153019,8 +153019,8 @@ SQLITE_PRIVATE int sqlite3Fts3ExprInitTestInterface(sqlite3* db){ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) /* #include */ -/* #include */ -/* #include */ +/* #include */ +/* #include */ /* #include "fts3_hash.h" */ @@ -153404,9 +153404,9 @@ SQLITE_PRIVATE void *sqlite3Fts3HashInsert( #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) /* #include */ -/* #include */ -/* #include */ -/* #include */ +/* #include */ +/* #include */ +/* #include */ /* #include "fts3_tokenizer.h" */ @@ -154070,7 +154070,7 @@ SQLITE_PRIVATE void sqlite3Fts3PorterTokenizerModule( #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) /* #include */ -/* #include */ +/* #include */ /* ** Return true if the two-argument version of fts3_tokenizer() @@ -154272,7 +154272,7 @@ SQLITE_PRIVATE int sqlite3Fts3InitTokenizer( #else # include "tcl.h" #endif -/* #include */ +/* #include */ /* ** Implementation of a special SQL scalar function for testing tokenizers @@ -154588,9 +154588,9 @@ SQLITE_PRIVATE int sqlite3Fts3InitHashTable( #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) /* #include */ -/* #include */ -/* #include */ -/* #include */ +/* #include */ +/* #include */ +/* #include */ /* #include "fts3_tokenizer.h" */ @@ -154840,7 +154840,7 @@ SQLITE_PRIVATE void sqlite3Fts3SimpleTokenizerModule( /* #include "fts3Int.h" */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) -/* #include */ +/* #include */ /* #include */ typedef struct Fts3tokTable Fts3tokTable; @@ -155276,9 +155276,9 @@ SQLITE_PRIVATE int sqlite3Fts3InitTok(sqlite3 *db, Fts3Hash *pHash){ /* #include "fts3Int.h" */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) -/* #include */ +/* #include */ /* #include */ -/* #include */ +/* #include */ #define FTS_MAX_APPENDABLE_HEIGHT 16 @@ -160954,7 +160954,7 @@ SQLITE_PRIVATE int sqlite3Fts3Optimize(Fts3Table *p){ /* #include "fts3Int.h" */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) -/* #include */ +/* #include */ /* #include */ /* @@ -162124,7 +162124,7 @@ static int fts3MatchinfoLcs(Fts3Cursor *pCsr, MatchInfo *pInfo){ ** be returned by the matchinfo() function. Argument zArg contains the ** format string passed as the second argument to matchinfo (or the ** default value "pcx" if no second argument was specified). The format -** c_string has already been validated and the pInfo->aMatchinfo[] array +** string has already been validated and the pInfo->aMatchinfo[] array ** is guaranteed to be large enough for the output. ** ** If bGlobal is true, then populate all fields of the matchinfo() output. @@ -162668,9 +162668,9 @@ SQLITE_PRIVATE void sqlite3Fts3Matchinfo( #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) /* #include */ -/* #include */ -/* #include */ -/* #include */ +/* #include */ +/* #include */ +/* #include */ /* #include "fts3_tokenizer.h" */ @@ -163473,9 +163473,9 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int c, int bRemoveDiacritic){ /* #include "sqlite3.h" */ #endif -/* #include */ +/* #include */ /* #include */ -/* #include */ +/* #include */ #ifndef SQLITE_AMALGAMATION #include "sqlite3rtree.h" @@ -168105,8 +168105,8 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( */ /* #include */ -/* #include */ -/* #include */ +/* #include */ +/* #include */ /* #include "sqlite3.h" */ @@ -174118,7 +174118,7 @@ SQLITE_PRIVATE int sqlite3DbstatRegister(sqlite3 *db){ return SQLITE_OK; } #if defined(SQLITE_ENABLE_SESSION) && defined(SQLITE_ENABLE_PREUPDATE_HOOK) /* #include "sqlite3session.h" */ /* #include */ -/* #include */ +/* #include */ #ifndef SQLITE_AMALGAMATION /* # include "sqliteInt.h" */ @@ -178800,8 +178800,8 @@ SQLITE_API int sqlite3changeset_concat_strm( #endif SQLITE_EXTENSION_INIT1 /* #include */ -/* #include */ -/* #include */ +/* #include */ +/* #include */ /* #include */ /* Mark a function parameter as unused, to suppress nuisance compiler @@ -181812,7 +181812,7 @@ struct fts5_api { /* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 -/* #include */ +/* #include */ /* #include */ #ifndef SQLITE_AMALGAMATION @@ -182624,7 +182624,7 @@ static int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic); ** The following is the concatenation of all %include directives from the ** input grammar file: */ -/* #include */ +/* #include */ /************ Begin %include sections from the grammar ************************/ /* #include "fts5Int.h" */ @@ -182929,7 +182929,7 @@ struct fts5yyParser { typedef struct fts5yyParser fts5yyParser; #ifndef NDEBUG -/* #include */ +/* #include */ static FILE *fts5yyTraceFILE = 0; static char *fts5yyTracePrompt = 0; #endif /* NDEBUG */ @@ -185988,7 +185988,7 @@ static void *sqlite3Fts5ParserAlloc(void *(*mallocProc)(u64)); static void sqlite3Fts5ParserFree(void*, void (*freeProc)(void*)); static void sqlite3Fts5Parser(void*, int, Fts5Token, Fts5Parse*); #ifndef NDEBUG -/* #include */ +/* #include */ static void sqlite3Fts5ParserTrace(FILE*, char*); #endif diff --git a/app/tsl2561/tsl2561.h b/app/tsl2561/tsl2561.h index 23c8f1b3..af322b55 100644 --- a/app/tsl2561/tsl2561.h +++ b/app/tsl2561/tsl2561.h @@ -33,7 +33,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /**************************************************************************/ -#include "c_types.h" +#include #ifndef _TSL2561_H_ #define _TSL2561_H_ diff --git a/app/websocket/websocketclient.c b/app/websocket/websocketclient.c index b96e4726..b03fad4d 100644 --- a/app/websocket/websocketclient.c +++ b/app/websocket/websocketclient.c @@ -27,9 +27,8 @@ #include "espconn.h" #include "mem.h" #include "limits.h" -#include "stdlib.h" - -#include "c_types.h" +#include +#include #include #include #include diff --git a/sdk-overrides/include/c_types.h b/sdk-overrides/include/c_types.h new file mode 100644 index 00000000..6d455802 --- /dev/null +++ b/sdk-overrides/include/c_types.h @@ -0,0 +1,6 @@ +#ifndef _SDKOVERRIDES_C_TYPES_H_ +#define _SDKOVERRIDES_C_TYPES_H_ + +#error "Please do not use c_types.h, use instead" + +#endif diff --git a/sdk-overrides/include/ets_sys.h b/sdk-overrides/include/ets_sys.h index 157e835f..eae2c1b5 100644 --- a/sdk-overrides/include/ets_sys.h +++ b/sdk-overrides/include/ets_sys.h @@ -1,6 +1,10 @@ #ifndef SDK_OVERRIDES_INCLUDE_ETS_SYS_H_ #define SDK_OVERRIDES_INCLUDE_ETS_SYS_H_ +#include +#include +#include + #include_next "ets_sys.h" #include diff --git a/sdk-overrides/include/osapi.h b/sdk-overrides/include/osapi.h index 4e503f8a..c192fa0d 100644 --- a/sdk-overrides/include/osapi.h +++ b/sdk-overrides/include/osapi.h @@ -1,9 +1,12 @@ #ifndef _SDK_OVERRIDE_OSAPI_H_ #define _SDK_OVERRIDE_OSAPI_H_ +#include +#include +#include + #include_next "osapi.h" -#include #include "rom.h" unsigned int uart_baudrate_detect(unsigned int uart_no, unsigned int async); diff --git a/sdk-overrides/include/stdbool.h b/sdk-overrides/include/stdbool.h index 2d7131d3..b9f36899 100644 --- a/sdk-overrides/include/stdbool.h +++ b/sdk-overrides/include/stdbool.h @@ -2,6 +2,11 @@ #define __stdbool_h__ // For compatibility with SDK. Boo. -#include_next "c_types.h" +typedef unsigned char bool; +#define BOOL bool +#define true (1) +#define false (0) +#define TRUE true +#define FALSE false #endif diff --git a/sdk-overrides/include/stdint.h b/sdk-overrides/include/stdint.h new file mode 100644 index 00000000..8930dea8 --- /dev/null +++ b/sdk-overrides/include/stdint.h @@ -0,0 +1,65 @@ +#ifndef _SDKOVERRIDES_STDINT_H_ +#define _SDKOVERRIDES_STDINT_H_ + +#include_next "stdint.h" + +// Compatibility cruft from c_types.h, ideally we should get rid of this! +typedef signed char sint8_t; +typedef signed short sint16_t; +typedef signed int sint32_t; +typedef signed long long sint64_t; +typedef unsigned long long u_int64_t; +typedef float real32_t; +typedef double real64_t; + +typedef unsigned char uint8; +typedef unsigned char u8; +typedef signed char sint8; +typedef signed char int8; +typedef signed char s8; +typedef unsigned short uint16; +typedef unsigned short u16; +typedef signed short sint16; +typedef signed short s16; +typedef unsigned int uint32; +typedef unsigned int u_int; +typedef unsigned int u32; +typedef signed int sint32; +typedef signed int s32; +typedef int int32; +typedef signed long long sint64; +typedef unsigned long long uint64; +typedef unsigned long long u64; +typedef float real32; +typedef double real64; + +#define __le16 u16 + +// And this stuff really doesn't belong in a types file in the first place... +#ifndef __packed +#define __packed __attribute__((packed)) +#endif + +#define LOCAL static + +typedef enum { + OK = 0, + FAIL, + PENDING, + BUSY, + CANCEL, +} STATUS; + +#define BIT(nr) (1UL << (nr)) + +#define REG_SET_BIT(_r, _b) (*(volatile uint32_t*)(_r) |= (_b)) +#define REG_CLR_BIT(_r, _b) (*(volatile uint32_t*)(_r) &= ~(_b)) + +#define DMEM_ATTR __attribute__((section(".bss"))) +#define SHMEM_ATTR + +#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text"))) +#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text"))) +#define STORE_ATTR __attribute__((aligned(4))) + +#endif diff --git a/sdk-overrides/include/stdlib.h b/sdk-overrides/include/stdlib.h index a420d3ca..276ca77b 100644 --- a/sdk-overrides/include/stdlib.h +++ b/sdk-overrides/include/stdlib.h @@ -2,7 +2,7 @@ #define _OVERRIDE_STDLIB_H_ #include_next "stdlib.h" - +#include #include "mem.h" #define free os_free diff --git a/sdk-overrides/include/user_interface.h b/sdk-overrides/include/user_interface.h index 200ee6df..267abf63 100644 --- a/sdk-overrides/include/user_interface.h +++ b/sdk-overrides/include/user_interface.h @@ -1,6 +1,10 @@ #ifndef SDK_OVERRIDES_INCLUDE_USER_INTERFACE_H_ #define SDK_OVERRIDES_INCLUDE_USER_INTERFACE_H_ +#include +#include +#include + #include_next "user_interface.h" bool wifi_softap_deauth(uint8 mac[6]);