From c1b0c1bac10c8e4c570347c684eb0d91de8d4a62 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 15 Feb 2016 17:09:44 -0500 Subject: [PATCH] libCom/misc: testMain for RTEMS give weak alias for main() Allows tests to be linked separately or in a common test harness --- src/libCom/misc/testMain.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libCom/misc/testMain.h b/src/libCom/misc/testMain.h index 4db72c39e..7c4d9b29b 100644 --- a/src/libCom/misc/testMain.h +++ b/src/libCom/misc/testMain.h @@ -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