diff --git src/c/include/recordio.h src/c/include/recordio.h
index 73ada1e..65af239 100644
--- src/c/include/recordio.h
+++ src/c/include/recordio.h
@@ -70,7 +70,7 @@ void close_buffer_iarchive(struct iarchive **ia);
char *get_buffer(struct oarchive *);
int get_buffer_len(struct oarchive *);
-int64_t htonll(int64_t v);
+int64_t zoo_htonll(int64_t v);
diff --git src/c/src/recordio.c src/c/src/recordio.c
index 968fdc4..07217c1 100644
@@ -80,7 +80,7 @@ int oa_serialize_int(struct oarchive *oa, const char *tag, const int32_t *d)
-int64_t htonll(int64_t v)
+int64_t zoo_htonll(int64_t v)
@@ -98,7 +98,7 @@ int64_t htonll(int64_t v)
int oa_serialize_long(struct oarchive *oa, const char *tag, const int64_t *d)
- const int64_t i = htonll(*d);
+ const int64_t i = zoo_htonll(*d);
struct buff_struct *priv = oa->priv;
if ((priv->len - priv->off) < sizeof(i)) {
int rc = resize_buffer(priv, priv->len + sizeof(i));
@@ -207,7 +207,7 @@ int ia_deserialize_long(struct iarchive *ia, const char *tag, int64_t *count)
memcpy(count, priv->buffer+priv->off, sizeof(*count));
priv->off+=sizeof(*count);
- v = htonll(*count); // htonll and ntohll do the same
+ v = zoo_htonll(*count); // htonll and ntohll do the same
diff --git src/c/src/zookeeper.c src/c/src/zookeeper.c
index ca81a1b..8225094 100644
--- src/c/src/zookeeper.c
+++ src/c/src/zookeeper.c
@@ -1798,7 +1798,7 @@ static int serialize_prime_connect(struct connect_req *req, char* buffer){
memcpy(buffer + offset, &req->protocolVersion, sizeof(req->protocolVersion));
offset = offset + sizeof(req->protocolVersion);
- req->lastZxidSeen = htonll(req->lastZxidSeen);
+ req->lastZxidSeen = zoo_htonll(req->lastZxidSeen);
memcpy(buffer + offset, &req->lastZxidSeen, sizeof(req->lastZxidSeen));
offset = offset + sizeof(req->lastZxidSeen);
@@ -1806,7 +1806,7 @@ static int serialize_prime_connect(struct connect_req *req, char* buffer){
memcpy(buffer + offset, &req->timeOut, sizeof(req->timeOut));
offset = offset + sizeof(req->timeOut);
- req->sessionId = htonll(req->sessionId);
+ req->sessionId = zoo_htonll(req->sessionId);