This repository was archived by the owner on Aug 9, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMain.hx
More file actions
55 lines (47 loc) · 1.17 KB
/
Main.hx
File metadata and controls
55 lines (47 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package;
class Main {
public static function main () {
// http://old.haxe.org/ref/conditionals
// http://haxe.org/manual/lf-condition-compilation.html
var i : Int;
#if cpp
// Specific code for C++ target
i = 1;
trace("Selected C++ target");
#elseif cs
// Specific code for C# target
i = 2;
trace("Selected CSharp target");
#elseif js
// Specific code for JavaScript target
i = 3;
trace("Selected JavaScript target");
#elseif neko
// Specific code for Neko target
i = 4;
trace("Selected Neko target");
#else
#error // will display "Haven't realization for target platform"
#error "Custom error" // will display "Custom error"
i = -1;
trace("Selected unknown target");
#end
trace("Value of i: " + i);
#if debug
trace("Debugging information included for all targets");
#if (debug_level > 3)
trace("Debugging level: " + 3);
#else
trace("Debugging level is too low");
#end
#end
#if (neko && mydebug)
trace("Debugging information included for Neko target");
#end
#if (haxe_ver >= 3.2)
trace("Version of Haxe >= 3.2");
#else
trace("Version of Haxe < 3.2");
#end
}
}