Author: michim
Date: Fri Nov 30 20:43:09 2012
New Revision: 1415847

URL: http://svn.apache.org/viewvc?rev=1415847&view=rev
Log:
ZOOKEEPER-1591. Windows build is broken because inttypes.h doesn't exist
(Marshall McMullen via michim)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/c/include/recordio.h
    zookeeper/trunk/src/c/src/addrvec.h
    zookeeper/trunk/src/c/src/recordio.c
    zookeeper/trunk/src/c/src/zookeeper.c

Modified: zookeeper/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1415847&r1=1415846&r2=1415847&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Fri Nov 30 20:43:09 2012
@@ -270,6 +270,9 @@ BUGFIXES:
   ZOOKEEPER-1474. Cannot build Zookeeper with IBM Java: use of Sun
   MXBean classes (Adalberto Medeiros via phunt)
 
+  ZOOKEEPER-1591. Windows build is broken because inttypes.h doesn't exist
+  (Marshall McMullen via michim)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

Modified: zookeeper/trunk/src/c/include/recordio.h
URL: 
http://svn.apache.org/viewvc/zookeeper/trunk/src/c/include/recordio.h?rev=1415847&r1=1415846&r2=1415847&view=diff
==============================================================================
--- zookeeper/trunk/src/c/include/recordio.h (original)
+++ zookeeper/trunk/src/c/include/recordio.h Fri Nov 30 20:43:09 2012
@@ -19,10 +19,7 @@
 #define __RECORDIO_H__
 
 #include <sys/types.h>
-#ifndef WIN32
-#define STRUCT_INITIALIZER(l,r) .l = r
-#else
-#define STRUCT_INITIALIZER(l,r)  r
+#ifdef WIN32
 #include "winconfig.h"
 #endif
 

Modified: zookeeper/trunk/src/c/src/addrvec.h
URL: 
http://svn.apache.org/viewvc/zookeeper/trunk/src/c/src/addrvec.h?rev=1415847&r1=1415846&r2=1415847&view=diff
==============================================================================
--- zookeeper/trunk/src/c/src/addrvec.h (original)
+++ zookeeper/trunk/src/c/src/addrvec.h Fri Nov 30 20:43:09 2012
@@ -19,8 +19,6 @@
 #ifndef ADDRVEC_H_
 #define ADDRVEC_H_
 
-#include <inttypes.h>
-
 #ifndef WIN32
 #include <sys/types.h>
 #include <sys/socket.h>

Modified: zookeeper/trunk/src/c/src/recordio.c
URL: 
http://svn.apache.org/viewvc/zookeeper/trunk/src/c/src/recordio.c?rev=1415847&r1=1415846&r2=1415847&view=diff
==============================================================================
--- zookeeper/trunk/src/c/src/recordio.c (original)
+++ zookeeper/trunk/src/c/src/recordio.c Fri Nov 30 20:43:09 2012
@@ -278,21 +278,27 @@ int ia_deserialize_string(struct iarchiv
     return 0;
 }
 
-static struct iarchive ia_default = { STRUCT_INITIALIZER (start_record 
,ia_start_record),
-        STRUCT_INITIALIZER (end_record ,ia_end_record), STRUCT_INITIALIZER 
(start_vector , ia_start_vector),
-        STRUCT_INITIALIZER (end_vector ,ia_end_vector), STRUCT_INITIALIZER 
(deserialize_Bool , ia_deserialize_bool),
-        STRUCT_INITIALIZER (deserialize_Int ,ia_deserialize_int),
-        STRUCT_INITIALIZER (deserialize_Long , ia_deserialize_long) ,
-        STRUCT_INITIALIZER (deserialize_Buffer, ia_deserialize_buffer),
-        STRUCT_INITIALIZER (deserialize_String, ia_deserialize_string)   };
-
-static struct oarchive oa_default = { STRUCT_INITIALIZER (start_record , 
oa_start_record),
-        STRUCT_INITIALIZER (end_record , oa_end_record), STRUCT_INITIALIZER 
(start_vector , oa_start_vector),
-        STRUCT_INITIALIZER (end_vector , oa_end_vector), STRUCT_INITIALIZER 
(serialize_Bool , oa_serialize_bool),
-        STRUCT_INITIALIZER (serialize_Int , oa_serialize_int),
-        STRUCT_INITIALIZER (serialize_Long , oa_serialize_long) ,
-        STRUCT_INITIALIZER (serialize_Buffer , oa_serialize_buffer),
-        STRUCT_INITIALIZER (serialize_String , oa_serialize_string) };
+static struct iarchive ia_default = {
+        ia_start_record,
+        ia_end_record,
+        ia_start_vector,
+        ia_end_vector,
+        ia_deserialize_bool,
+        ia_deserialize_int,
+        ia_deserialize_long ,
+        ia_deserialize_buffer,
+        ia_deserialize_string};
+
+static struct oarchive oa_default = {
+        oa_start_record,
+        oa_end_record,
+        oa_start_vector,
+        oa_end_vector,
+        oa_serialize_bool,
+        oa_serialize_int,
+        oa_serialize_long ,
+        oa_serialize_buffer,
+        oa_serialize_string};
 
 struct iarchive *create_buffer_iarchive(char *buffer, int len)
 {

Modified: zookeeper/trunk/src/c/src/zookeeper.c
URL: 
http://svn.apache.org/viewvc/zookeeper/trunk/src/c/src/zookeeper.c?rev=1415847&r1=1415846&r2=1415847&view=diff
==============================================================================
--- zookeeper/trunk/src/c/src/zookeeper.c (original)
+++ zookeeper/trunk/src/c/src/zookeeper.c Fri Nov 30 20:43:09 2012
@@ -1620,7 +1620,7 @@ static void auth_completion_func(int rc,
 
 static int send_info_packet(zhandle_t *zh, auth_info* auth) {
     struct oarchive *oa;
-    struct RequestHeader h = { STRUCT_INITIALIZER(xid , AUTH_XID), 
STRUCT_INITIALIZER(type , ZOO_SETAUTH_OP)};
+    struct RequestHeader h = {AUTH_XID, ZOO_SETAUTH_OP};
     struct AuthPacket req;
     int rc;
     oa = create_buffer_oarchive();
@@ -1688,7 +1688,7 @@ static void free_key_list(char **list, i
 static int send_set_watches(zhandle_t *zh)
 {
     struct oarchive *oa;
-    struct RequestHeader h = { STRUCT_INITIALIZER(xid , SET_WATCHES_XID), 
STRUCT_INITIALIZER(type , ZOO_SETWATCHES_OP)};
+    struct RequestHeader h = {SET_WATCHES_XID, ZOO_SETWATCHES_OP};
     struct SetWatches req;
     int rc;
 
@@ -1842,7 +1842,7 @@ static struct timeval get_timeval(int in
  {
     int rc;
     struct oarchive *oa = create_buffer_oarchive();
-    struct RequestHeader h = { STRUCT_INITIALIZER(xid ,PING_XID), 
STRUCT_INITIALIZER (type , ZOO_PING_OP) };
+    struct RequestHeader h = {PING_XID, ZOO_PING_OP};
 
     rc = serialize_RequestHeader(oa, "header", &h);
     enter_critical(zh);
@@ -2311,7 +2311,7 @@ static int deserialize_multi(int xid, co
 {
     int rc = 0;
     completion_head_t *clist = &cptr->c.clist;
-    struct MultiHeader mhdr = { STRUCT_INITIALIZER(type , 0), 
STRUCT_INITIALIZER(done , 0), STRUCT_INITIALIZER(err , 0) };
+    struct MultiHeader mhdr = {0, 0, 0};
     assert(clist);
     deserialize_MultiHeader(ia, "multiheader", &mhdr);
     while (!mhdr.done) {
@@ -2850,7 +2850,7 @@ int zookeeper_close(zhandle_t *zh)
      * destroy the handle later. */
     if(zh->state==ZOO_CONNECTED_STATE){
         struct oarchive *oa;
-        struct RequestHeader h = { STRUCT_INITIALIZER (xid , get_xid()), 
STRUCT_INITIALIZER (type , ZOO_CLOSE_OP)};
+        struct RequestHeader h = {get_xid(), ZOO_CLOSE_OP};
         LOG_INFO(("Closing zookeeper sessionId=%#llx to [%s]\n",
                 zh->client_id.client_id,zoo_get_current_server(zh)));
         oa = create_buffer_oarchive();
@@ -2976,7 +2976,7 @@ int zoo_awget(zhandle_t *zh, const char 
 {
     struct oarchive *oa;
     char *server_path = prepend_string(zh, path);
-    struct RequestHeader h = { STRUCT_INITIALIZER (xid , get_xid()), 
STRUCT_INITIALIZER (type ,ZOO_GETDATA_OP)};
+    struct RequestHeader h = {get_xid(), ZOO_GETDATA_OP};
     struct GetDataRequest req =  { (char*)server_path, watcher!=0 };
     int rc;
 
@@ -3028,7 +3028,7 @@ int zoo_aset(zhandle_t *zh, const char *
         int version, stat_completion_t dc, const void *data)
 {
     struct oarchive *oa;
-    struct RequestHeader h = { STRUCT_INITIALIZER(xid , get_xid()), 
STRUCT_INITIALIZER (type , ZOO_SETDATA_OP)};
+    struct RequestHeader h = {get_xid(), ZOO_SETDATA_OP};
     struct SetDataRequest req;
     int rc = SetDataRequest_init(zh, &req, path, buffer, buflen, version);
     if (rc != ZOK) {
@@ -3082,7 +3082,7 @@ int zoo_acreate(zhandle_t *zh, const cha
         string_completion_t completion, const void *data)
 {
     struct oarchive *oa;
-    struct RequestHeader h = { STRUCT_INITIALIZER (xid , get_xid()), 
STRUCT_INITIALIZER (type ,ZOO_CREATE_OP) };
+    struct RequestHeader h = {get_xid(), ZOO_CREATE_OP};
     struct CreateRequest req;
 
     int rc = CreateRequest_init(zh, &req, 
@@ -3124,7 +3124,7 @@ int zoo_adelete(zhandle_t *zh, const cha
         void_completion_t completion, const void *data)
 {
     struct oarchive *oa;
-    struct RequestHeader h = { STRUCT_INITIALIZER (xid , get_xid()), 
STRUCT_INITIALIZER (type , ZOO_DELETE_OP)};
+    struct RequestHeader h = {get_xid(), ZOO_DELETE_OP};
     struct DeleteRequest req;
     int rc = DeleteRequest_init(zh, &req, path, version);
     if (rc != ZOK) {
@@ -3160,7 +3160,7 @@ int zoo_awexists(zhandle_t *zh, const ch
         stat_completion_t completion, const void *data)
 {
     struct oarchive *oa;
-    struct RequestHeader h = { STRUCT_INITIALIZER (xid ,get_xid()), 
STRUCT_INITIALIZER (type , ZOO_EXISTS_OP) };
+    struct RequestHeader h = {get_xid(), ZOO_EXISTS_OP};
     struct ExistsRequest req;
     int rc = Request_path_watch_init(zh, 0, &req.path, path, 
             &req.watch, watcher != NULL);
@@ -3194,7 +3194,7 @@ static int zoo_awget_children_(zhandle_t
          const void *data)
 {
     struct oarchive *oa;
-    struct RequestHeader h = { STRUCT_INITIALIZER (xid , get_xid()), 
STRUCT_INITIALIZER (type , ZOO_GETCHILDREN_OP)};
+    struct RequestHeader h = {get_xid(), ZOO_GETCHILDREN_OP};
     struct GetChildrenRequest req ;
     int rc = Request_path_watch_init(zh, 0, &req.path, path, 
             &req.watch, watcher != NULL);
@@ -3242,7 +3242,7 @@ static int zoo_awget_children2_(zhandle_
 {
     /* invariant: (sc == NULL) != (sc == NULL) */
     struct oarchive *oa;
-    struct RequestHeader h = { STRUCT_INITIALIZER( xid, get_xid()), 
STRUCT_INITIALIZER (type ,ZOO_GETCHILDREN2_OP)};
+    struct RequestHeader h = {get_xid(), ZOO_GETCHILDREN2_OP};
     struct GetChildren2Request req ;
     int rc = Request_path_watch_init(zh, 0, &req.path, path, 
             &req.watch, watcher != NULL);
@@ -3287,7 +3287,7 @@ int zoo_async(zhandle_t *zh, const char 
         string_completion_t completion, const void *data)
 {
     struct oarchive *oa;
-    struct RequestHeader h = { STRUCT_INITIALIZER (xid , get_xid()), 
STRUCT_INITIALIZER (type , ZOO_SYNC_OP)};
+    struct RequestHeader h = {get_xid(), ZOO_SYNC_OP};
     struct SyncRequest req;
     int rc = Request_path_init(zh, 0, &req.path, path);
     if (rc != ZOK) {
@@ -3317,7 +3317,7 @@ int zoo_aget_acl(zhandle_t *zh, const ch
         const void *data)
 {
     struct oarchive *oa;
-    struct RequestHeader h = { STRUCT_INITIALIZER (xid , get_xid()), 
STRUCT_INITIALIZER(type ,ZOO_GETACL_OP)};
+    struct RequestHeader h = {get_xid(), ZOO_GETACL_OP};
     struct GetACLRequest req;
     int rc = Request_path_init(zh, 0, &req.path, path) ;
     if (rc != ZOK) {
@@ -3346,7 +3346,7 @@ int zoo_aset_acl(zhandle_t *zh, const ch
         struct ACL_vector *acl, void_completion_t completion, const void *data)
 {
     struct oarchive *oa;
-    struct RequestHeader h = { STRUCT_INITIALIZER(xid ,get_xid()), 
STRUCT_INITIALIZER (type , ZOO_SETACL_OP)};
+    struct RequestHeader h = {get_xid(), ZOO_SETACL_OP};
     struct SetACLRequest req;
     int rc = Request_path_init(zh, 0, &req.path, path);
     if (rc != ZOK) {
@@ -3431,8 +3431,8 @@ static int CheckVersionRequest_init(zhan
 int zoo_amulti(zhandle_t *zh, int count, const zoo_op_t *ops,
         zoo_op_result_t *results, void_completion_t completion, const void 
*data)
 {
-    struct RequestHeader h = { STRUCT_INITIALIZER(xid, get_xid()), 
STRUCT_INITIALIZER(type, ZOO_MULTI_OP) };
-    struct MultiHeader mh = { STRUCT_INITIALIZER(type, -1), 
STRUCT_INITIALIZER(done, 1), STRUCT_INITIALIZER(err, -1) };
+    struct RequestHeader h = {get_xid(), ZOO_MULTI_OP};
+    struct MultiHeader mh = {-1, 1, -1};
     struct oarchive *oa = create_buffer_oarchive();
     completion_head_t clist = { 0 };
 
@@ -3444,7 +3444,7 @@ int zoo_amulti(zhandle_t *zh, int count,
         zoo_op_result_t *result = results+index;
         completion_list_t *entry = NULL;
 
-        struct MultiHeader mh = { STRUCT_INITIALIZER(type, op->type), 
STRUCT_INITIALIZER(done, 0), STRUCT_INITIALIZER(err, -1) };
+        struct MultiHeader mh = {op->type, 0, -1};
         rc = rc < 0 ? rc : serialize_MultiHeader(oa, "multiheader", &mh);
 
         switch(op->type) {


Reply via email to