Allow our main to accept arguments

This commit is contained in:
George Oikonomou 2017-10-15 17:33:05 +01:00 committed by George Oikonomou
parent c41cd3b75e
commit f89da621d9
2 changed files with 16 additions and 0 deletions

View File

@ -57,7 +57,11 @@
#include <stdint.h>
/*---------------------------------------------------------------------------*/
int
#if PLATFORM_MAIN_ACCEPTS_ARGS
main(int argc, char **argv)
#else
main(void)
#endif
{
platform_init_stage_one();

View File

@ -98,6 +98,18 @@
#define PLATFORM_PROVIDES_MAIN_LOOP 0
#endif
/*---------------------------------------------------------------------------*/
/**
* Controls whether the main function accepts arguments
*
* By default our main does not accept arguments. However, when running on
* native targets, command line arguments to main are required.
*/
#ifdef PLATFORM_CONF_MAIN_ACCEPTS_ARGS
#define PLATFORM_MAIN_ACCEPTS_ARGS PLATFORM_CONF_MAIN_ACCEPTS_ARGS
#else
#define PLATFORM_MAIN_ACCEPTS_ARGS 0
#endif
/*---------------------------------------------------------------------------*/
/**
* \brief Basic (Stage 1) platform driver initialisation.
*