Skip to content

Proposal: Different #define handling in ofMain.h #6948

@dimitre

Description

@dimitre

What I'm proposing here is having certain defines to see if some functionality is included or not, which can be based on platform as it is now, but can be used independent of platform too.
#undef is very useful here because we can make the exceptions independent of the previously set #defines.

I mean previously set because we can make this defines in the project itself using GCC preprocessor (tested here and working)
and it can be easily set per project.

Ideas? suggestions?

#define OF_LIB_USE_THREAD
#define OF_LIB_USE_CAIRO
#define OF_LIB_USE_SERIAL
#define OF_LIB_USE_SOUND

#ifdef TARGET_NO_SOUND
	#undef OF_LIB_USE_SOUND
#endif

#if defined(TARGET_EMSCRIPTEN)
	#undef OF_LIB_USE_THREAD
#endif 

#if defined( TARGET_OF_IOS ) | defined(TARGET_ANDROID) | defined(TARGET_EMSCRIPTEN)
	#undef OF_LIB_USE_SERIAL
	#undef OF_LIB_USE_CAIRO
#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions