This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add newer malloc.c from Ilya Zakharevich <ilya@math.ohio-state.edu>
[perl5.git] / bytecode.h
index e86c146..3e8a6a9 100644 (file)
@@ -2,7 +2,7 @@ typedef char *pvcontents;
 typedef char *strconst;
 typedef U32 PV;
 typedef char *op_tr_array;
-typedef int comment;
+typedef int comment_t;
 typedef SV *svindex;
 typedef OP *opindex;
 typedef IV IV64;
@@ -28,11 +28,11 @@ EXT I32 obj_list_fill INIT(-1);
 #endif /* INDIRECT_BGET_MACROS */
 
 #define BGET_U32(arg)  \
-       BGET_FREAD(&arg, sizeof(U32), 1); arg = ntohl((U32)arg)
+       BGET_FREAD(&arg, sizeof(U32), 1); arg = PerlSock_ntohl((U32)arg)
 #define BGET_I32(arg)  \
-       BGET_FREAD(&arg, sizeof(I32), 1); arg = (I32)ntohl((U32)arg)
+       BGET_FREAD(&arg, sizeof(I32), 1); arg = (I32)PerlSock_ntohl((U32)arg)
 #define BGET_U16(arg)  \
-       BGET_FREAD(&arg, sizeof(U16), 1); arg = ntohs((U16)arg)
+       BGET_FREAD(&arg, sizeof(U16), 1); arg = PerlSock_ntohs((U16)arg)
 #define BGET_U8(arg)   arg = BGET_FGETC()
 
 #if INDIRECT_BGET_MACROS
@@ -92,7 +92,7 @@ EXT I32 obj_list_fill INIT(-1);
        New(666, ary, 256, unsigned short); \
        BGET_FREAD(ary, 256, 2);        \
        for (i = 0; i < 256; i++)       \
-           ary[i] = ntohs(ary[i]);     \
+           ary[i] = PerlSock_ntohs(ary[i]);    \
        arg = (char *) ary;             \
     } while (0)
 
@@ -108,11 +108,13 @@ EXT I32 obj_list_fill INIT(-1);
        arg = atof(str);                \
     } STMT_END
 
-#define BGET_objindex(arg) STMT_START {        \
-       U32 ix;                         \
-       BGET_U32(ix);                   \
-       arg = obj_list[ix];             \
+#define BGET_objindex(arg, type) STMT_START {  \
+       U32 ix;                                 \
+       BGET_U32(ix);                           \
+       arg = (type)obj_list[ix];               \
     } STMT_END
+#define BGET_svindex(arg) BGET_objindex(arg, svindex)
+#define BGET_opindex(arg) BGET_objindex(arg, opindex)
 
 #define BSET_ldspecsv(sv, arg) sv = specialsv_list[arg]