Major clean-ups. Migrating to C++11.
[invirt/third/libt4.git] / rpc / marshall.h
index e0370d1..644a220 100644 (file)
@@ -11,7 +11,6 @@
 #include <cstddef>
 #include <inttypes.h>
 #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<sizeof(req_header), sizeof(reply_header)>::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<sizeof(req_header), sizeof(reply_header)>::value + sizeof(rpc_sz_t)
+#define RPC_HEADER_SZ (RPC_HEADER_SZ_NO_CHECKSUM)
 #endif
-};
 
 class marshall {
        private: