On Thu, 20 Oct 2005 13:12, Rob D wrote:
As a developer of several applications that need to run on Windows and *nix, I am VERY interested in knowing more about the possible ways to accomplish this, and would be more than willing to help update whatever stuff is required.
There is an old patch for linking a Winelib as an ordinary executable file on wiki.winehq.org
There was also some discussion last year with the Mono people that suggested a system involving the use of longjmp from a WinMain back to the "main" program loop, which would ensure that Wine initialisation had taken place, although this might create problems for exception handling, and you may have to deallocate a bunch of memory Wine pre-allocates to make that system work.
Another technique would be to use a custom ctr0.o which caused a custom WinMain to be called that then called on to "main", thus running the Linux executable on the Wine stack.
Another approach would be to use the preprocessor to redefine "main" to something else in your real "main", then have a "main" in a separate module that called the Wine initialisation code, and a WinMain that called the renamed "main".