浏览代码

Merge pull request #2385 from zaynyatyi/development

absolute-path check in cpp target
Nicolas Cannasse 11 年之前
父节点
当前提交
d9cbe38a59
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      gencpp.ml

+ 4 - 4
gencpp.ml

@@ -1148,8 +1148,9 @@ let gen_hash seed str =
    Printf.sprintf "0x%08lx" !h
 ;;
 
-let strip_file ctx file =
-	let flen = String.length file in
+let strip_file ctx file = (match Common.defined ctx Common.Define.AbsolutePath with
+   | true -> file
+   | false -> let flen = String.length file in
 	(* Not quite right - should probably test is file exists *)
    try
 		List.iter (fun path ->
@@ -1159,10 +1160,9 @@ let strip_file ctx file =
 			 (ctx.class_path @ ctx.std_path);
 		file;
 	with PathFound tail ->
-      tail
+      tail)
 ;;
 
-
 let hx_stack_push ctx output clazz func_name pos =
    let stripped_file = strip_file ctx.ctx_common pos.pfile in
    let qfile = "\"" ^ (Ast.s_escape stripped_file) ^ "\"" in