Compile mg-iot-cc3200 with ARM compiler, step 1

Code size: 167144 vs 199440

More changes to come (console support, warnings cleanup).

PUBLISHED_FROM=cbc06efcb354c240654518b493496a69293ebc2a
This commit is contained in:
Deomid Ryabkov 2016-05-02 17:16:27 +02:00 committed by Sergey Lyubka
parent 91f6eedb24
commit 81bf4921d4
2 changed files with 32 additions and 2 deletions

View File

@ -4307,6 +4307,8 @@ struct mg_cgi_env_block {
int nvars; /* Number of variables in envp[] */ int nvars; /* Number of variables in envp[] */
}; };
#ifndef MG_DISABLE_FILESYSTEM
#define MIME_ENTRY(_ext, _type) \ #define MIME_ENTRY(_ext, _type) \
{ _ext, sizeof(_ext) - 1, _type } { _ext, sizeof(_ext) - 1, _type }
static const struct { static const struct {
@ -4364,8 +4366,6 @@ static const struct {
MIME_ENTRY("bmp", "image/bmp"), MIME_ENTRY("bmp", "image/bmp"),
{NULL, 0, NULL}}; {NULL, 0, NULL}};
#ifndef MG_DISABLE_FILESYSTEM
#ifndef MG_DISABLE_DAV #ifndef MG_DISABLE_DAV
static int mg_mkdir(const char *path, uint32_t mode) { static int mg_mkdir(const char *path, uint32_t mode) {
#ifndef _WIN32 #ifndef _WIN32
@ -10203,6 +10203,33 @@ int mg_set_protocol_coap(struct mg_connection *nc) {
#define CONSOLE_UART UARTA0_BASE #define CONSOLE_UART UARTA0_BASE
#ifdef __TI_COMPILER_VERSION__
int asprintf(char **strp, const char *fmt, ...) {
va_list ap;
int len;
*strp = malloc(BUFSIZ);
if (*strp == NULL) return -1;
va_start(ap, fmt);
len = vsnprintf(*strp, BUFSIZ, fmt, ap);
va_end(ap);
if (len > 0) {
*strp = realloc(*strp, len);
if (*strp == NULL) return -1;
}
if (len >= BUFSIZ) {
va_start(ap, fmt);
len = vsnprintf(*strp, len, fmt, ap);
va_end(ap);
}
return len;
}
#endif /* __TI_COMPILER_VERSION__ */
#ifndef __TI_COMPILER_VERSION__ #ifndef __TI_COMPILER_VERSION__
int _gettimeofday_r(struct _reent *r, struct timeval *tp, void *tzp) { int _gettimeofday_r(struct _reent *r, struct timeval *tp, void *tzp) {
#else #else

View File

@ -449,6 +449,9 @@ extern "C" {
struct SlTimeval_t; struct SlTimeval_t;
#define timeval SlTimeval_t #define timeval SlTimeval_t
int gettimeofday(struct timeval *t, void *tz); int gettimeofday(struct timeval *t, void *tz);
int asprintf(char **strp, const char *fmt, ...);
#endif #endif
long int random(void); long int random(void);