Marzac / le3d

A straightforward and easy to use 3D software renderer for real-time retro graphics.
https://marzac.github.io/le3d/
MIT License
60 stars 6 forks source link

Current version does not build on mac and amiga #27

Closed m0ppers closed 6 years ago

m0ppers commented 6 years ago

Unfortunately I can't build the current version :(

Both Amiga and MacOS complain about _strdup now (seems to be a windows hack?)

Not sure what to do. Just define _strdup strdup?

Mac: global.h:82 is now including malloc.h.

This file does not exist on the mac.

Also I am getting operator new is missing exception specification in clang on macos.

Also mac includes gamepad_unix :O

It might be time for a CI :D

m0ppers commented 6 years ago

ah also amiga is complaing about LE_USE_SIMD not being defined...When you accepted my pull request I thought the way would be to not define the LE_SIMD/SSE stuff for amiga. I don't mind to have everything defined for everything but currently unsure if this was a mistake or if it was intended :S

Marzac commented 6 years ago

Hi @m0ppers,

my bad! I totally fucked up the last commit...

I tried to clean up and homogenize the preprocessor definitions but I did several mistakes.

Weird that malloc.h does not exist on the mac as it is part of the C library basics. Anyway, not needed there.

strdup is a MSVC problem which is now fixed properly.

I fixed both Linux and Windows versions.

"new is missing exception specification" Is this a CLang error or just a warning? The whole engine is exception free, compiles with no-exceptions, and I would like to preserve it that way.

CI is an excellent idea.

Marzac commented 6 years ago

Concerning LE_USE_SIMD, LE_USE_SSE

There is a hierarchy for these flags. LE_USE_SIMD LE_USE_SSE LE_USE_AMMX

LE_USE_SIMD is meant to tell the compiler to use generic vectorisations optimisations and such. It's the basic level of SIMD. Then come either LE_USE_SSE or LE_USE_AMMX which are platform specifics. They make only sense enabled when LE_USE_SIMD is also enabled as they require some definitions and declarations introduced by LE_USE_SIMD to work (at least for SSE) (such as alignment, instruction set, ABI ...).

Marzac commented 6 years ago

As I said I would like the preprocessor definitions always defined. Which to me means (config.h.in):

/* Performance optimizations /

ifdef AMIGA

    #define LE_USE_SIMD                 ${LE3D_USE_SIMD}    
#define LE_USE_SSE2                 0
#define LE_USE_AMMX                 ${LE3D_USE_AMMX}                    /** Use Apollo AMMX instructions */

else

#define LE_USE_SIMD                 ${LE3D_USE_SIMD}                    /** Use SIMD instructions & vectors */
#define LE_USE_SSE2                 ${LE3D_USE_SSE2}                    /** Use Intel SSE2 instructions */
    #define LE_USE_AMMX                    0

endif // AMIGA

endif // LE_CONFIG_H

Marzac commented 6 years ago

Well it does now :-) @m0ppers I had to right an hack for timing measurement on MacOs based on some suggestions I found on StackOverflow. I have not yet checked if this work as intended. It should also be cleaned up somehow.

Marzac commented 6 years ago

I think we can close this issue now.