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

@ -6,7 +6,7 @@
if SYSTEM_EMBEDLOG
config EXAMPLES_EMBEDLOG
bool "embedlog example"
tristate "embedlog example"
default n
select EMBEDLOG_ENABLE_OUT_FILE
select EMBEDLOG_ENABLE_OUT_STDERR
@ -26,7 +26,6 @@ if EXAMPLES_EMBEDLOG
config EXAMPLES_EMBEDLOG_PROGNAME
string "Program name"
default "embedlog"
depends on BUILD_KERNEL
---help---
This is the name of the program that will be used when the NSH ELF
program is installed.

View file

@ -37,19 +37,14 @@ include $(TOPDIR)/Make.defs
# embedlog example built-in application info
CONFIG_EXAMPLES_EMBEDLOG_PRIORITY ?= SCHED_PRIORITY_DEFAULT
CONFIG_EXAMPLES_EMBEDLOG_STACKSIZE ?= 2048
APPNAME = $(CONFIG_EXAMPLES_EMBEDLOG_PROGNAME)
PROGNAME = $(CONFIG_EXAMPLES_EMBEDLOG_PROGNAME)
PRIORITY = $(CONFIG_EXAMPLES_EMBEDLOG_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_EMBEDLOG_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_EMBEDLOG)
# embedlog Example
MAINSRC = embedlog_main.c
CFLAGS += -I$(APPDIR)/include/system
CONFIG_EXAMPLES_EMBEDLOG_PROGNAME ?= embedlog$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_EMBEDLOG_PROGNAME)
include $(APPDIR)/Application.mk

View file

@ -317,11 +317,7 @@ static void el_print_file(const char *workdir)
* embedlog_main
****************************************************************************/
#ifdef CONFIG_BUILD_KERNEL
int main(int argc, FAR char *argv[])
#else
int embedlog_main(int argc, FAR char *argv[])
#endif
{
if (argc > 2 || (argc == 2 && strcmp(argv[1], "-h") == 0))
{