mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-02 17:28:30 +00:00
Introduce new linker for fat ape binaries
This commit is contained in:
parent
e3c456d23a
commit
0105e3e2b6
44 changed files with 3140 additions and 867 deletions
21
tool/hello/hello-pe.c
Normal file
21
tool/hello/hello-pe.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
#if 0
|
||||
/*─────────────────────────────────────────────────────────────────╗
|
||||
│ To the extent possible under law, Justine Tunney has waived │
|
||||
│ all copyright and related or neighboring rights to this file, │
|
||||
│ as it is written in the following disclaimers: │
|
||||
│ • http://unlicense.org/ │
|
||||
│ • http://creativecommons.org/publicdomain/zero/1.0/ │
|
||||
╚─────────────────────────────────────────────────────────────────*/
|
||||
#endif
|
||||
#include "tool/build/elf2pe.h"
|
||||
|
||||
#define STD_OUTPUT_HANDLE -11u
|
||||
|
||||
__dll_import("kernel32.dll", long, GetStdHandle, (unsigned));
|
||||
__dll_import("kernel32.dll", int, WriteFile,
|
||||
(long, const void *, unsigned, unsigned *, void *));
|
||||
|
||||
__attribute__((__ms_abi__)) long WinMain(void) {
|
||||
WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), "hello world\n", 12, 0, 0);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue