Skip to content

Commit 9e13f67

Browse files
ComerLaterRbb666
authored andcommitted
删除libcpu/sim/simulator中msvc编译器多余代码,为后续支持mingw64做准备
Signed-off-by: latercomer <[email protected]>
1 parent 76c2f2d commit 9e13f67

File tree

2 files changed

+8
-42
lines changed

2 files changed

+8
-42
lines changed

libcpu/sim/win32/cpu_port.c

-11
Original file line numberDiff line numberDiff line change
@@ -699,14 +699,3 @@ rt_uint32_t YieldInterruptHandle(void)
699699

700700
return 0;
701701
} /*** YieldInterruptHandle ***/
702-
703-
/* system entry */
704-
extern int rtthread_startup(void);
705-
int wmain(int argc, char* argv[])
706-
{
707-
/* disable interrupt first */
708-
rt_hw_interrupt_disable();
709-
/* startup RT-Thread RTOS */
710-
rtthread_startup();
711-
}
712-
#pragma comment(linker, "/subsystem:console /entry:wmainCRTStartup")

libcpu/sim/win32/startup.c libcpu/sim/win32/startup_msvc.c

+8-31
Original file line numberDiff line numberDiff line change
@@ -221,33 +221,16 @@ void rt_application_init(void);
221221
void rt_hw_board_init(void);
222222
int rtthread_startup(void);
223223

224-
#if defined(__ARMCC_VERSION)
225-
extern int $Super$$main(void);
226-
/* re-define main function */
227-
int $Sub$$main(void)
228-
{
229-
rtthread_startup();
230-
return 0;
231-
}
232-
#elif defined(__ICCARM__)
233-
extern int main(void);
234-
/* __low_level_init will auto called by IAR cstartup */
235-
extern void __iar_data_init3(void);
236-
int __low_level_init(void)
237-
{
238-
// call IAR table copy function.
239-
__iar_data_init3();
240-
rtthread_startup();
241-
return 0;
242-
}
243-
#elif defined(__GNUC__)
244-
/* Add -eentry to arm-none-eabi-gcc argument */
245-
int entry(void)
224+
/* system entry */
225+
extern int rtthread_startup(void);
226+
int wmain(int argc, char* argv[])
246227
{
228+
/* disable interrupt first */
229+
rt_hw_interrupt_disable();
230+
/* startup RT-Thread RTOS */
247231
rtthread_startup();
248-
return 0;
249232
}
250-
#endif
233+
#pragma comment(linker, "/subsystem:console /entry:wmainCRTStartup")
251234

252235
#ifndef RT_USING_HEAP
253236
/* if there is not enable heap, we should use static thread and stack. */
@@ -269,15 +252,9 @@ void main_thread_entry(void *parameter)
269252
#ifdef RT_USING_SMP
270253
rt_hw_secondary_cpu_up();
271254
#endif
255+
272256
/* invoke system main function */
273-
#if defined(__ARMCC_VERSION)
274-
{
275-
extern int $Super$$main(void);
276-
$Super$$main(); /* for ARMCC. */
277-
}
278-
#elif defined(__ICCARM__) || defined(__GNUC__) || defined(__TASKING__) || defined(_MSC_VER)
279257
main();
280-
#endif
281258
}
282259

283260
void rt_application_init(void)

0 commit comments

Comments
 (0)