-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13d9528
commit 08d6e32
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
pragma windows_only | ||
|
||
import 'sys/cstdio.adept' | ||
|
||
alias HANDLE = ptr | ||
alias HINSTANCE = HANDLE | ||
alias LPSTR = *ubyte | ||
|
||
record Bomb (message *ubyte) { | ||
func __defer__ { | ||
printf('%s\n', this.message) | ||
} | ||
} | ||
|
||
bomb Bomb = Bomb('Hello World') | ||
|
||
external stdcall func WinMain(hInstance, hPrevInstance HINSTANCE, lpCmdLine LPSTR, nCmdShow int) int { | ||
// The initialization of 'bomb' and its automatic '__defer__' call should | ||
// happen here implicitly | ||
} | ||
|
||
/* | ||
If no main function exists, and an 'external stdcall func WinMain' exists, | ||
then it will be treated as the entry point | ||
*/ |