Re: [hatari-devel] Building Hatari 2.xx on Windows platform (?)

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On 06/27/2017 07:53 PM, Christian Zietz wrote:
Douglas Little schrieb:

The SDL2 crash was seen using the latest libs for mingw (via cygwin
setup). Not sure what's wrong there but SDL1 seems to work ok in any case.

Some time ago, I also built Hatari (from the Mercurial repo and rather
painlessly) under Windows using MinGW. In order for the SDL2 build not
to crash after startup, I had to make sure that the preprocessor macro
SDL_MAIN_HANDLED was defined during compilation. I did this via a change
to CMakeLists.txt:

  if(SDL2_FOUND)
         add_definitions(-DWITH_SDL2)
+       add_definitions(-DSDL_MAIN_HANDLED=1)

I never really investigated what happened; so I didn't report it,
either. I think the basic idea behind SDL_MAIN_HANDLED is explained
here: <http://djrollins.com/2016/10/02/sdl-on-windows/>. But since I do
not know much about SDL, I cannot say what goes wrong with Hatari when
the macro is not defined.

Looking at current CMakeLists.txt, I don't see above change for
Windows, but I do see thing done for OSX:
--------------------------
if(ENABLE_OSX_BUNDLE)
        # Use OSX native alert windows
        add_definitions(-DALERT_HOOKS=1)
        if(SDL2_FOUND)
                # We still want to use our SDLMain.m with SDL2
                add_definitions(-DSDL_MAIN_NEEDED=1)
        endif(SDL2_FOUND)
endif(ENABLE_OSX_BUNDLE)
--------------------------

Are "-DSDL_MAIN_HANDLED=1" and "-DSDL_MAIN_NEEDED=1" anyway
related?  And if yes, which one would be more correct?

(I don't know anything about Windows or OSX specific SDL versions.)


	- Eero




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/