Permalink
Browse files

fix unix build

  • Loading branch information...
1 parent 1da1b24 commit 6d48b73e390c0579438b1d4be56ba5c3bb24c845 @fantasyni fantasyni committed Mar 25, 2013
Showing with 112 additions and 78 deletions.
  1. +2 −2 include/pomelo-protobuf/pb-util.h
  2. +7 −2 include/pomelo.h
  3. +29 −0 pomelo.gyp
  4. +45 −45 src/pb-decode.c
  5. +29 −29 src/pb-encode.c
@@ -27,14 +27,14 @@ int pb__get_constant_type(const char *type);
* messages if not used.
*/
#ifdef PB_NO_ERRMSG
-#define PB_RETURN_ERROR(stream,msg) return false
+#define PB_RETURN_ERROR(stream,msg) return 0
#define PB_GET_ERROR(stream) "(errmsg disabled)"
#else
#define PB_RETURN_ERROR(stream,msg) \
do {\
if ((stream)->errmsg == NULL) \
(stream)->errmsg = (msg); \
- return false; \
+ return 0; \
} while(0)
#define PB_GET_ERROR(stream) ((stream)->errmsg ? (stream)->errmsg : "(none)")
#endif
View
@@ -47,7 +47,12 @@ typedef struct pc_request_s pc_request_t;
typedef struct pc_notify_s pc_notify_t;
typedef struct pc_msg_s pc_msg_t;
typedef struct pc_pkg_parser_s pc_pkg_parser_t;
+
+#ifdef _WIN32
typedef struct uv_buf_t pc_buf_t;
+#else
+typedef struct pc_buf_s pc_buf_t;
+#endif
/**
* State machine for Pomelo package parser
@@ -194,10 +199,10 @@ typedef void (*pc_msg_encode_done_cb)(pc_client_t *client, pc_buf_t buf);
* Simple structure for memory block.
* The pc_buf_s is cheap and could be passed by value.
*/
-/*struct pc_buf_s {
+struct pc_buf_s {
char *base;
size_t len;
-};*/
+};
/**
* Transport structure.
View
@@ -73,6 +73,11 @@
}
],
['OS != "win"',{
+ 'defines':[
+ '_LARGEFILE_SOURCE',
+ '_FILE_OFFSET_BITS=64',
+ '_GNU_SOURCE',
+ ],
'ldflags': [
'-no-undefined',
'-export-symbols-regex \'^json_\'',
@@ -124,6 +129,14 @@
],
},
}
+ ],
+ ['OS != "win" ',{
+ 'defines':[
+ '_LARGEFILE_SOURCE',
+ '_FILE_OFFSET_BITS=64',
+ '_GNU_SOURCE',
+ ]
+ }
]
],
},
@@ -170,6 +183,14 @@
},
}
],
+ ['OS != "win" ',{
+ 'defines':[
+ '_LARGEFILE_SOURCE',
+ '_FILE_OFFSET_BITS=64',
+ '_GNU_SOURCE',
+ ]
+ }
+ ]
]
},
{
@@ -215,6 +236,14 @@
},
}
],
+ ['OS != "win" ',{
+ 'defines':[
+ '_LARGEFILE_SOURCE',
+ '_FILE_OFFSET_BITS=64',
+ '_GNU_SOURCE',
+ ]
+ }
+ ]
]
}
],
Oops, something went wrong.

0 comments on commit 6d48b73

Please sign in to comment.