2
0
Эх сурвалжийг харах

[cpp] Remove wide string code

Hugh Sanderson 12 жил өмнө
parent
commit
921ace67db
1 өөрчлөгдсөн 1 нэмэгдсэн , 14 устгасан
  1. 1 14
      gencpp.ml

+ 1 - 14
gencpp.ml

@@ -648,11 +648,6 @@ let has_utf8_chars s =
 	done;
 	!result;;
 
-let escape_null s =
-	let b = Buffer.create 0 in
-   String.iter (fun ch -> if (ch=='\x00') then Buffer.add_string b "\\000" else Buffer.add_char b ch ) s;
-   Buffer.contents b;;
-
 let escape_command s =
 	let b = Buffer.create 0 in
    String.iter (fun ch -> if (ch=='"' || ch=='\\' ) then Buffer.add_string b "\\";  Buffer.add_char b ch ) s;
@@ -661,15 +656,7 @@ let escape_command s =
 
 let str s =
 	let escaped = Ast.s_escape s in
-      let null_escaped = escape_null escaped in
-        if (has_utf8_chars escaped) then begin
-		(* Output both wide and thin versions - let the compiler choose ... *)
-		let l = ref (String.length escaped) in
-		let q = escape_stringw (Ast.s_escape s) l in
-		("HX_CSTRING2(" ^ q ^ "," ^ (string_of_int !l) ^ ",\"" ^ (special_to_hex null_escaped) ^ "\" )")
-        end else
-		(* The wide and thin versions are the same ...  *)
-		("HX_CSTRING(\"" ^ (special_to_hex null_escaped) ^ "\")")
+		("HX_CSTRING(\"" ^ (special_to_hex escaped) ^ "\")")
 ;;