-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a platform abstraction layer #122
Comments
I figured out the core is already nicely separated via e_platform.h, but it could probably be improved by splitting it into separate files. The benefit would be that This is what I'm thining about:
I have not yet looked into the modules, everything else (executive, eeltest, includes and compiler) should be fine. |
I think abort() should also be wrapped. (No need to wrap exit() as it's just a hack and not supposed to be reached due to the longjmp()) |
Sounds reasonable! As for EEL_PLATFORM_INLINE, I think that's something that was lost in translation when moving from Autotools to CMake. It's supposed to take care of compilers that don't have the 'inline' keyword. |
Some parts of the EEL core relies on functions only available on certain operating system. This means there is
#ifdef _WIN32_
,#ifdef __MACOSX__
, etc in the code. A better solution would be to keep the code clean from those #ifdef's and instead use an abstraction layer.I suggest we add a subdirectoy called ./src/platform. This directory should have the files win32.c, macosx.c and linux.c (or similar). A define in CMakeLists.txt tells the compiler which one it should compile and link to.
Modules like eelium should link to the global platform file above, for generic stuff. And if needed provide their own platform directory.
The abstraction layer should also wrap memory allocations and other things that might be useful to change when running on an embedded and/or realtime system.
I don't think printing text should be a part of this abstraction layer. See #123.
The text was updated successfully, but these errors were encountered: