From 5f12cd8feaf3b098e45a1c0480911c7157674acf Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Mon, 9 Apr 2018 01:20:11 +0200 Subject: [PATCH] Use CONSOLE entry points consistently --- .../posts/01-freestanding-rust-binary/index.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md b/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md index c434c5d31..f08544548 100644 --- a/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md +++ b/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md @@ -280,8 +280,6 @@ pub extern "C" fn main() -> ! { } ``` -We just call `WinMain` from `WinMainCRTStartup` to avoid any ambiguity which function is called. - #### macOS macOS [does not support statically linked binaries], so we have to link the `libSystem` library. The entry point is called `main`: @@ -330,12 +328,12 @@ pub extern "C" fn _start() -> ! { // On Windows: #[no_mangle] -pub extern "C" fn WinMainCRTStartup() -> ! { - WinMain(); +pub extern "C" fn mainCRTStartup() -> ! { + main(); } #[no_mangle] -pub extern "C" fn WinMain() -> ! { +pub extern "C" fn main() -> ! { loop {} }