Skip to content

Commit

Permalink
Use CONSOLE entry points consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-opp committed Apr 8, 2018
1 parent 2a00afa commit 5f12cd8
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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`:

Expand Down Expand Up @@ -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 {}
}

Expand Down

0 comments on commit 5f12cd8

Please sign in to comment.