Pixel Perfect
Member
|
Conditional compilation directives
Excuse my cross platform ignorance but, although I am currently only targeting my game @ Windows, I would like to maintain my code as cross platform as possible. Can I freely use conditional compilation directives such as:
#define identifier
#ifdef identifier
// code
#else
// code
#endif
and expect those to be implemented by the target compilers on the other platforms?
|
|
06-11-2013 05:42 PM |
|
Rubeus
Member
|
RE: Conditional compilation directives
You can, but if you are using the EE 2.0 code editor, it doesn't recognize them across multiple files.
I'm counting on being able to use the engine versions like EE_MOBILE.
|
|
06-11-2013 06:51 PM |
|
Pixel Perfect
Member
|
RE: Conditional compilation directives
Thanks for the quick response Rubeus.
|
|
06-11-2013 07:07 PM |
|
shadow
Member
|
RE: Conditional compilation directives
EE already has some predefined macros which you can view in the Esenthel headers, such as:
WINDOWS
MAC
ANDROID
IOS
X64
MOBILE
To my knowledge this is the recommended way.
(This post was last modified: 06-17-2013 05:17 PM by shadow.)
|
|
06-17-2013 05:16 PM |
|
Pixel Perfect
Member
|
RE: Conditional compilation directives
My interest was more in providing conditional compilation to exclude embedded tools code when doing a game release as opposed to conditional compilation to do with platform targets.
|
|
06-17-2013 11:35 PM |
|
Rubeus
Member
|
RE: Conditional compilation directives
I just put all my configuration and tools/debug info into 2 files. Not the best solution, but it works.
|
|
06-18-2013 06:23 AM |
|
shadow
Member
|
RE: Conditional compilation directives
There is also following macro available:
DEBUG (when in debug mode)
and
const bool EE_RELEASE; (which is always true for publishing)
|
|
06-18-2013 07:54 PM |
|