Application.mk and main.c files: Change builtin's entry point from main to xxx_main by macro expansion. This change make the entry point fully compliant with POSIX/ANSI standard.

This commit is contained in:
Xiang Xiao 2019-10-06 06:14:39 -06:00 • committed by Gregory Nutt
parent ab7c5a7d4e
commit e806097c70
550 changed files with 664 additions and 2928 deletions

View file

@ -4,7 +4,7 @@
#
config NETUTILS_THTTPD
tristate "THTTPD webserver"
bool "THTTPD webserver"
default n
depends on NXFLAT || FS_BINFS
---help---

View file

@ -39,13 +39,9 @@ include $(TOPDIR)/Make.defs
ifeq ($(CONFIG_NET_TCP),y)
CSRCS += libhttpd.c thttpd_cgi.c thttpd_alloc.c thttpd_strings.c timers.c
CSRCS += fdwatch.c tdate_parse.c
MAINSRC += thttpd.c
CSRCS += fdwatch.c tdate_parse.c thttpd.c
endif
CONFIG_XYZ_PROGNAME ?= thttpd$(EXEEXT)
PROGNAME = $(CONFIG_XYZ_PROGNAME)
# CGI binaries (examples only, not used in the build)
ifeq ($(CONFIG_THTTPD_NXFLAT),y)
@ -59,19 +55,12 @@ ifeq ($(CONFIG_THTTPD_BINFS),y)
CSRCS += phf.c redirect.c ssi.c
DEPPATHS += --dep-path cgi-src
VPATH += :cgi-src
PROGNAME = phf redirect ssi
PRIORITY = $(CONFIG_THTTPD_CGI_PRIORITY)
STACKSIZE = $(CONFIG_THTTPD_CGI_STACKSIZE)
endif
ifneq ($(CONFIG_BUILD_LOADABLE),y)
OBJS += $(MAINOBJ)
endif
CONFIG_THTTPD_CGI_PRIORITY ?= 100
CONFIG_THTTPD_CGI_STACKSIZE ?= 2048
APPNAME = phf redirect ssi
PRIORITY = $(CONFIG_THTTPD_CGI_PRIORITY)
STACKSIZE = $(CONFIG_THTTPD_CGI_STACKSIZE)
context:: $(SUBDIR_BIN)
ifeq ($(CONFIG_THTTPD_NXFLAT),y)
@ -97,6 +86,4 @@ cgi-bin$(DELIM)$(SUBDIR_BIN3): cgi-bin cgi-src$(DELIM)$(SUBDIR_BIN3)
$(Q) cp -a cgi-src$(DELIM)$(SUBDIR_BIN3) $@
endif
MODULE = CONFIG_NETUTILS_THTTPD
include $(APPDIR)/Application.mk

View file

@ -652,11 +652,7 @@ static void occasional(ClientData client_data, struct timeval *nowP)
*
****************************************************************************/
#ifdef BUILD_MODULE
int main(int argc, FAR char *argv[])
#else
int thttpd_main(int argc, char **argv)
#endif
{
int num_ready;
int cnum;