I'm using SDL for a little game and since I need a map in this game I was using SDLMappy to do that. Now on Windows everything worked perfectly fine, I had an example map designed, saved as a .FMP file and the program was loading and showing it perfectly.
Recently I switched to Linux (Manjaro). I am using CLion with Cmake now and the program compiles fine (after a lot of other stuff I had to change for linux), but the map can't load anymore. With debugging I found out, that the error occurs here:
if (mapfilesize!=static_cast<long int>(mapbyteswapl(mapgenheader.headsize) + 8)) maperror = MER_MAPLOADERROR;
mapfilesize is 3698985 and the other side of the inequality evaluates to 1179468120
I googled quite a while about this, but it seems like SDLMappy isn't used very much. Also the link to the linux version on the SDLMappy Site seems to be outdated, at least for me it's going nowhere.
Something else that may have to do with this is, that at some point in the SDLMappy code there is a fopen_s call which isn't working under linux. I used the define
#define fopen_s(fp, fmt, mode) *(fp)=fopen( (fmt), (mode))
to fix this, but I don't know if there are any differences in reading a file with fopen and fopen_s in Windows/Linux that may be causing the issue. I couldn't find anything.