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

@ -14,7 +14,6 @@ if EXAMPLES_HELLO
config EXAMPLES_HELLO_PROGNAME
string "Program name"
default "hello"
depends on BUILD_LOADABLE
---help---
This is the name of the program that will be used when the NSH ELF
program is installed.

View file

@ -37,21 +37,13 @@ include $(TOPDIR)/Make.defs
# Hello, World! built-in application info
CONFIG_EXAMPLES_HELLO_PRIORITY ?= SCHED_PRIORITY_DEFAULT
CONFIG_EXAMPLES_HELLO_STACKSIZE ?= 2048
APPNAME = hello
PROGNAME = $(CONFIG_EXAMPLES_HELLO_PROGNAME)
PRIORITY = $(CONFIG_EXAMPLES_HELLO_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_HELLO_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_HELLO)
# Hello, World! Example
MAINSRC = hello_main.c
CONFIG_EXAMPLES_HELLO_PROGNAME ?= hello$(EXEEXT)
PROGNAME = $(CONFIG_EXAMPLES_HELLO_PROGNAME)
MODULE = CONFIG_EXAMPLES_HELLO
include $(APPDIR)/Application.mk

View file

@ -48,11 +48,7 @@
* hello_main
****************************************************************************/
#if defined(BUILD_MODULE)
int main(int argc, FAR char *argv[])
#else
int hello_main(int argc, char *argv[])
#endif
{
printf("Hello, World!!\n");
return 0;