X-Git-Url: http://xvm.mit.edu/gitweb/invirt/third/libt4.git/blobdiff_plain/61809b48ade4c21b1b01931d520aa2abc7507032..a4175b2e216a20b86cc872dea8a08005c60617a5:/rpc/marshall.h?ds=sidebyside diff --git a/rpc/marshall.h b/rpc/marshall.h index e0370d1..644a220 100644 --- a/rpc/marshall.h +++ b/rpc/marshall.h @@ -11,7 +11,6 @@ #include #include #include "lang/verify.h" -#include "lang/algorithm.h" struct req_header { req_header(int x=0, int p=0, int c = 0, int s = 0, int xi = 0): @@ -32,16 +31,15 @@ struct reply_header { typedef uint64_t rpc_checksum_t; typedef int rpc_sz_t; -enum { - //size of initial buffer allocation - DEFAULT_RPC_SZ = 1024, +//size of initial buffer allocation +#define DEFAULT_RPC_SZ 1024 +#define RPC_HEADER_SZ_NO_CHECKSUM (std::max(sizeof(req_header), sizeof(reply_header)) + sizeof(rpc_sz_t)) #if RPC_CHECKSUMMING - //size of rpc_header includes a 4-byte int to be filled by tcpchan and uint64_t checksum - RPC_HEADER_SZ = static_max::value + sizeof(rpc_sz_t) + sizeof(rpc_checksum_t) +//size of rpc_header includes a 4-byte int to be filled by tcpchan and uint64_t checksum +#define RPC_HEADER_SZ (RPC_HEADER_SZ_NO_CHECKSUM + sizeof(rpc_checksum_t)) #else - RPC_HEADER_SZ = static_max::value + sizeof(rpc_sz_t) +#define RPC_HEADER_SZ (RPC_HEADER_SZ_NO_CHECKSUM) #endif -}; class marshall { private: