Pages: 1
Author Topic: Preprocessors  (26,887 Views)
Offline (Unknown gender) Josh @ Dreamland

Prince of all Goldfish
Developer
Joined: Feb 2008
Posts: 2,950
View profile
Posted on: September 13, 2012, 04:13:41 PM
Since ENIGMA supports compilation on a wide variety of platforms, and soon, a small variety of languages, it is going to become necessary to give the user a way to deal with that.

Now, C++ gives a fine way of doing that: Preprocessors. The issue with C preprocessors is that they are ugly. They must be the first thing on a line, and must consume the entire line. In EDL, we'll want to fix that.

My proposal is that preprocessors be given by [snip]{{}}[/snip]. So, if you wanted a piece of code to run only on Mac, you'd use something like this:


{{if ENIGMA_Platform == "ios"}} gamecenter_initialize(); {{endif}} // Initialize the game center if we're on iOS
highscore_add(name, score);


That will bring up the game center on iOS, or something. Ask TGMG; I really have no clue about iOS.
Pages: 1