core: intro `is_windows`
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 14 Aug 2016 14:10:56 +0000 (10:10 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sun, 14 Aug 2016 19:01:57 +0000 (15:01 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/core/kernel.nit

index fe45072..18dd7ac 100644 (file)
@@ -1073,3 +1073,12 @@ interface Task
        # Main method of this task
        fun main do end
 end
+
+# Is this program currently running in a Windows OS?
+fun is_windows: Bool `{
+#ifdef _WIN32
+       return 1;
+#else
+       return 0;
+#endif
+`}