-
Notifications
You must be signed in to change notification settings - Fork 3
Getting started
jwt27 edited this page Nov 11, 2021
·
13 revisions
jwdpmi has it's own main()
function, as it needs to intercept the --debug
option and terminate threads on exit. See src/main.cpp
if you're curious.
Your program's entry point is int jwdpmi_main(std::span<std::string_view>)
.
In order to build, the following compiler flags are required:
-std=gnu++20
-masm=intel
-fnon-call-exceptions
The configuration file jwdpmi_config.h
in the root directory allows you to change certain compile-time constants. Copy this file somewhere in your project, then call configure
with --jwdpmi-config=/path/to/config.h
.
jwdpmi is mostly tested to work with HDPMI32 and CWSDPMI. It should be compatible with most DPMI hosts, however. If you are compiling with SSE support, HDPMI32 is required in order to run your program.
int jwdpmi_main(const std::span<std::string_view> args)
{
std::cout << "Hello, World!\n";
for (auto&& arg : args.last(args.size() - 1))
std::cout << "Program argument: " << arg << '\n';
return 0;
}