Merge branch 'fix-ni' into wip
[nit.git] / src / native_interface / frontier.nit
index 232dbfb..2d42bd2 100644 (file)
@@ -45,8 +45,9 @@ redef class MMSrcModule
                        native_header = "{directory.path}/{name}_nit.h"
                end
                if native_header.file_exists then
-                       v.body.add( "#include \"{native_header.path_from_parent}\"\n" )
-                       v.header.add( "#include \"{native_header.path_from_parent}\"\n" )
+                       var path = "..".join_path(native_header).simplify_path
+                       v.body.add( "#include \"{path}\"\n" )
+                       v.header.add( "#include \"{path}\"\n" )
                end
 
                for local_class in local_classes do
@@ -312,21 +313,6 @@ class FrontierVisitor
        end
 end
 
-redef class String
-       # return path from one level deeper
-       # could be moved to stdlib.file
-       fun path_from_parent : String
-       do
-               if self[0] == '/' # is_absolute
-               then
-                       return self
-               else
-                       return "../{self}"
-               end
-
-       end
-end
-
 redef class MMImportedCast
        # Defines functions to cast types and verify the type of an object.
        fun compile_to_frontier( v : FrontierVisitor )