Browse Source

added bytes address 64

Nicolas Cannasse 1 năm trước cách đây
mục cha
commit
2bad7f41c8
1 tập tin đã thay đổi với 10 bổ sung0 xóa
  1. 10 0
      src/std/bytes.c

+ 10 - 0
src/std/bytes.c

@@ -237,6 +237,10 @@ HL_PRIM int hl_bytes_subtract( vbyte *a, vbyte *b ) {
 	return (int)(a - b);
 }
 
+HL_PRIM int_val hl_bytes_address64( vbyte *a ) {
+	return (int_val)a;
+}
+
 HL_PRIM int hl_bytes_address( vbyte *a, int *high ) {
 #	ifdef HL_64
 	*high = (int)(((uint64)a)>>32);
@@ -258,6 +262,10 @@ HL_PRIM vbyte *hl_bytes_from_address( int low, int high ) {
 #	endif
 }
 
+HL_PRIM vbyte *hl_bytes_from_address64( int_val v ) {
+	return (vbyte*)v;
+}
+
 HL_PRIM int hl_string_compare( vbyte *a, vbyte *b, int len ) {
 	return memcmp(a,b,len * sizeof(uchar));
 }
@@ -278,3 +286,5 @@ DEFINE_PRIM(_BYTES,bytes_offset, _BYTES _I32);
 DEFINE_PRIM(_I32,bytes_subtract, _BYTES _BYTES);
 DEFINE_PRIM(_I32,bytes_address, _BYTES _REF(_I32));
 DEFINE_PRIM(_BYTES,bytes_from_address, _I32 _I32);
+DEFINE_PRIM(_I64,bytes_address64, _BYTES);
+DEFINE_PRIM(_BYTES,bytes_from_address64, _I64);