mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-26 22:41:03 +08:00
Fix VC98 build
This commit is contained in:
parent
8321f9f6e9
commit
5aebed95a4
@ -6,22 +6,24 @@ CFLAGS_MONGOOSE += -DMG_HTTP_DIRLIST_TIME=1 -DMG_ENABLE_SSI=1
|
|||||||
CFLAGS_MONGOOSE += -DMG_ENABLE_LINES=1 -DMG_ENABLE_IPV6=1
|
CFLAGS_MONGOOSE += -DMG_ENABLE_LINES=1 -DMG_ENABLE_IPV6=1
|
||||||
|
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
# Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD
|
# Windows settings. Assume MinGW compiler. To use VC: make CC=cl CFLAGS=/MD OUT=/Feprog.exe
|
||||||
PROG ?= example.exe # Use .exe suffix for the binary
|
PROG ?= example.exe # Use .exe suffix for the binary
|
||||||
CC = gcc # Use MinGW gcc compiler
|
CC = gcc # Use MinGW gcc compiler
|
||||||
CFLAGS += -lws2_32 # Link against Winsock library
|
CFLAGS += -lws2_32 # Link against Winsock library
|
||||||
DELETE = cmd /C del /q /f /s # Command prompt command to delete files
|
DELETE = cmd /C del /q /f /s # Command prompt command to delete files
|
||||||
|
OUT ?= -o $(PROG) # Build output
|
||||||
else
|
else
|
||||||
# Mac, Linux
|
# Mac, Linux
|
||||||
PROG ?= example
|
PROG ?= example
|
||||||
DELETE = rm -rf
|
DELETE = rm -rf
|
||||||
|
OUT ?= -o $(PROG)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG)
|
||||||
$(RUN) ./$(PROG) $(ARGS)
|
$(RUN) ./$(PROG) $(ARGS)
|
||||||
|
|
||||||
$(PROG): $(SOURCES)
|
$(PROG): $(SOURCES)
|
||||||
$(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) -o $@
|
$(CC) $(SOURCES) $(CFLAGS) $(CFLAGS_MONGOOSE) $(CFLAGS_EXTRA) $(OUT)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(DELETE) $(PROG) *.o *.obj *.exe *.dSYM
|
$(DELETE) $(PROG) *.o *.obj *.exe *.dSYM
|
||||||
|
20
mongoose.c
20
mongoose.c
@ -1853,15 +1853,19 @@ static void printdirentry(const char *name, void *userdata) {
|
|||||||
mg_snprintf(sz, sizeof(sz), "%lld", (uint64_t) size);
|
mg_snprintf(sz, sizeof(sz), "%lld", (uint64_t) size);
|
||||||
}
|
}
|
||||||
#if defined(MG_HTTP_DIRLIST_TIME)
|
#if defined(MG_HTTP_DIRLIST_TIME)
|
||||||
char time_str[30];
|
{
|
||||||
struct tm *time_info = localtime(&t);
|
char time_str[30];
|
||||||
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
struct tm *time_info = localtime(&t);
|
||||||
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
||||||
|
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
||||||
|
}
|
||||||
#elif defined(MG_HTTP_DIRLIST_TIME_UTC)
|
#elif defined(MG_HTTP_DIRLIST_TIME_UTC)
|
||||||
char time_str[30];
|
{
|
||||||
struct tm *time_info = gmtime(&t);
|
char time_str[30];
|
||||||
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
struct tm *time_info = gmtime(&t);
|
||||||
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
||||||
|
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
mg_snprintf(mod, sizeof(mod), "%ld", (unsigned long) t);
|
mg_snprintf(mod, sizeof(mod), "%ld", (unsigned long) t);
|
||||||
#endif
|
#endif
|
||||||
|
20
src/http.c
20
src/http.c
@ -564,15 +564,19 @@ static void printdirentry(const char *name, void *userdata) {
|
|||||||
mg_snprintf(sz, sizeof(sz), "%lld", (uint64_t) size);
|
mg_snprintf(sz, sizeof(sz), "%lld", (uint64_t) size);
|
||||||
}
|
}
|
||||||
#if defined(MG_HTTP_DIRLIST_TIME)
|
#if defined(MG_HTTP_DIRLIST_TIME)
|
||||||
char time_str[30];
|
{
|
||||||
struct tm *time_info = localtime(&t);
|
char time_str[30];
|
||||||
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
struct tm *time_info = localtime(&t);
|
||||||
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
||||||
|
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
||||||
|
}
|
||||||
#elif defined(MG_HTTP_DIRLIST_TIME_UTC)
|
#elif defined(MG_HTTP_DIRLIST_TIME_UTC)
|
||||||
char time_str[30];
|
{
|
||||||
struct tm *time_info = gmtime(&t);
|
char time_str[30];
|
||||||
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
struct tm *time_info = gmtime(&t);
|
||||||
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
strftime(time_str, sizeof time_str, "%Y/%m/%d %H:%M:%S", time_info);
|
||||||
|
mg_snprintf(mod, sizeof(mod), "%s", time_str);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
mg_snprintf(mod, sizeof(mod), "%ld", (unsigned long) t);
|
mg_snprintf(mod, sizeof(mod), "%ld", (unsigned long) t);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user