Skip to content

Commit 5f12cd8

Browse files
committed
Use CONSOLE entry points consistently
1 parent 2a00afa commit 5f12cd8

File tree

1 file changed

+3
-5
lines changed
  • blog/content/second-edition/posts/01-freestanding-rust-binary

1 file changed

+3
-5
lines changed

blog/content/second-edition/posts/01-freestanding-rust-binary/index.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ pub extern "C" fn main() -> ! {
280280
}
281281
```
282282

283-
We just call `WinMain` from `WinMainCRTStartup` to avoid any ambiguity which function is called.
284-
285283
#### macOS
286284
macOS [does not support statically linked binaries], so we have to link the `libSystem` library. The entry point is called `main`:
287285

@@ -330,12 +328,12 @@ pub extern "C" fn _start() -> ! {
330328

331329
// On Windows:
332330
#[no_mangle]
333-
pub extern "C" fn WinMainCRTStartup() -> ! {
334-
WinMain();
331+
pub extern "C" fn mainCRTStartup() -> ! {
332+
main();
335333
}
336334

337335
#[no_mangle]
338-
pub extern "C" fn WinMain() -> ! {
336+
pub extern "C" fn main() -> ! {
339337
loop {}
340338
}
341339

0 commit comments

Comments
 (0)