mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-28 05:39:00 +08:00
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:
parent
91f6eedb24
commit
81bf4921d4
31
mongoose.c
31
mongoose.c
@ -4307,6 +4307,8 @@ struct mg_cgi_env_block {
|
||||
int nvars; /* Number of variables in envp[] */
|
||||
};
|
||||
|
||||
#ifndef MG_DISABLE_FILESYSTEM
|
||||
|
||||
#define MIME_ENTRY(_ext, _type) \
|
||||
{ _ext, sizeof(_ext) - 1, _type }
|
||||
static const struct {
|
||||
@ -4364,8 +4366,6 @@ static const struct {
|
||||
MIME_ENTRY("bmp", "image/bmp"),
|
||||
{NULL, 0, NULL}};
|
||||
|
||||
#ifndef MG_DISABLE_FILESYSTEM
|
||||
|
||||
#ifndef MG_DISABLE_DAV
|
||||
static int mg_mkdir(const char *path, uint32_t mode) {
|
||||
#ifndef _WIN32
|
||||
@ -10203,6 +10203,33 @@ int mg_set_protocol_coap(struct mg_connection *nc) {
|
||||
|
||||
#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__
|
||||
int _gettimeofday_r(struct _reent *r, struct timeval *tp, void *tzp) {
|
||||
#else
|
||||
|
@ -449,6 +449,9 @@ extern "C" {
|
||||
struct SlTimeval_t;
|
||||
#define timeval SlTimeval_t
|
||||
int gettimeofday(struct timeval *t, void *tz);
|
||||
|
||||
int asprintf(char **strp, const char *fmt, ...);
|
||||
|
||||
#endif
|
||||
|
||||
long int random(void);
|
||||
|
Loading…
Reference in New Issue
Block a user