libCom/misc: testMain for RTEMS give weak alias for main()

Allows tests to be linked separately or in a common test harness
This commit is contained in:
Michael Davidsaver
2016-02-15 17:09:44 -05:00
parent cffa2e8f46
commit c1b0c1bac1
+7 -1
View File
@@ -27,7 +27,13 @@
* }
*/
#if defined(vxWorks) || defined(__rtems__)
#if defined(__rtems__)
#ifdef __cplusplus
#define MAIN(prog) extern "C" int prog(void); extern "C" int main() __attribute__((weak, alias(#prog))); extern "C" int prog(void)
#else
#define MAIN(prog) int prog(); int main() __attribute__((weak, alias(#prog))); int prog()
#endif
#elif defined(vxWorks)
#ifdef __cplusplus
#define MAIN(prog) extern "C" int prog(void)
#else