Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

dos-like

Engine for making things with a MS-DOS feel, but for modern platforms · By Mattias Gustavsson

This lib looks like a lot of fun - but a question on the main method in dos.h???

A topic by deckarep created Apr 25, 2024 Views: 137 Replies: 1
Viewing posts 1 to 2

I'm actually trying to get this to compile with a language called Zig which integrates well with C...usually.

Question though: my main function written in Zig is interferring with the dos.h file's main function. I'm curious why the main function exists in the dos.h file and if it is completely necessary?

Is dos-like suppose to take over or own the main method?

Developer

Yeah, the way it works, is that the real main func is in dos.h, and it is definitely needed. But it would be possible to move its code (it just does a call to app_run) to your own if needed. However, in the user code (as in the samples) there is *another* main, but this one is actually called dosmain - there’s just a define in dos.h that defines main to be an alias for dosmain. Defining NO_MAIN_DEF disables this, and your user main has to be named dosmain instead of main