Hand main()'s arguments over to the platform

This commit is contained in:
George Oikonomou 2017-10-15 18:00:20 +01:00 committed by George Oikonomou
parent c3c5668ccd
commit 5d95f8bd54
2 changed files with 17 additions and 1 deletions

View File

@ -59,10 +59,12 @@
int
#if PLATFORM_MAIN_ACCEPTS_ARGS
main(int argc, char **argv)
{
platform_process_args(argc, argv);
#else
main(void)
#endif
{
#endif
platform_init_stage_one();
clock_init();

View File

@ -201,6 +201,20 @@ void platform_idle(void);
*/
void platform_main_loop(void);
/*---------------------------------------------------------------------------*/
/**
* \brief Allow the platform to process main's command line arguments
*
* If the platform wishes main() to accept arguments, then the \os main will
* call this function here so that the platform can process/store those
* arguments.
*
* This function will only get called if PLATFORM_MAIN_ACCEPTS_ARGS
* is non-zero.
*
* It is the port developer's responsibility to implement this function.
*/
void platform_process_args(int argc, char**argv);
/*---------------------------------------------------------------------------*/
#endif /* PLATFORM_H_ */
/*---------------------------------------------------------------------------*/
/**