Saturday, May 22, 2010

Compiling Code for Platforms

In class we have learned how to only compile certain code when programming for multi-platforms.
I will go over this just for a quick over view.

Remember anything using the # sign talks directly with the compiler.

In order to define the platforms, use the following format,

# DEFINE Linux 10
# DEFINE Windows 111
# DEFINE Mac 121

# DEFINE Platform Linux

After this is done, use the format

# if Platform=Linux /* Or any of the others */
/* do code */

# endif

/* Do for rest of platforms*/

No comments:

Post a Comment