Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
9de8295b
Commit
9de8295b
authored
Jul 18, 2012
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pb: Clean _TYPECHECK name generation
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
a710f617
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
protobuf.h
include/protobuf.h
+7
-7
No files found.
include/protobuf.h
View file @
9de8295b
...
...
@@ -27,17 +27,17 @@ extern int pb_read_object_with_header(int fd, void **pobj,
pb_unpack_t
unpack
,
bool
eof
);
#define PB_UNPACK_TYPECHECK(__op, __fn) ({ if (0) *__op = __fn
(NULL, 0, NULL); (pb_unpack_t)&__fn
; })
#define PB_PACK_TYPECHECK(__o, __fn) ({ if (0) __fn
(__o, NULL); (pb_pack_t)&__fn
; })
#define PB_GPS_TYPECHECK(__o, __fn) ({ if (0) __fn
(__o); (pb_getpksize_t)&__fn
; })
#define PB_UNPACK_TYPECHECK(__op, __fn) ({ if (0) *__op = __fn
##__unpack(NULL, 0, NULL); (pb_unpack_t)&__fn##__unpack
; })
#define PB_PACK_TYPECHECK(__o, __fn) ({ if (0) __fn
##__pack(__o, NULL); (pb_pack_t)&__fn##__pack
; })
#define PB_GPS_TYPECHECK(__o, __fn) ({ if (0) __fn
##__get_packed_size(__o); (pb_getpksize_t)&__fn##__get_packed_size
; })
#define pb_read(__fd, __obj_pptr, __proto_message_name) \
pb_read_object_with_header(__fd, (void **)__obj_pptr, \
PB_UNPACK_TYPECHECK(__obj_pptr, __proto_message_name
##__unpack
), false)
PB_UNPACK_TYPECHECK(__obj_pptr, __proto_message_name), false)
#define pb_read_eof(__fd, __obj_pptr, __proto_message_name) \
pb_read_object_with_header(__fd, (void **)__obj_pptr, \
PB_UNPACK_TYPECHECK(__obj_pptr, __proto_message_name
##__unpack
), true)
PB_UNPACK_TYPECHECK(__obj_pptr, __proto_message_name), true)
extern
int
pb_write_object_with_header
(
int
fd
,
void
*
obj
,
pb_getpksize_t
getpksize
,
...
...
@@ -45,8 +45,8 @@ extern int pb_write_object_with_header(int fd, void *obj,
#define pb_write(__fd, __obj, __proto_message_name) \
pb_write_object_with_header(__fd, __obj, \
PB_GPS_TYPECHECK(__obj, __proto_message_name
##__get_packed_size),
\
PB_PACK_TYPECHECK(__obj, __proto_message_name
##__pack
))
PB_GPS_TYPECHECK(__obj, __proto_message_name
),
\
PB_PACK_TYPECHECK(__obj, __proto_message_name))
#define pb_pksize(__obj, __proto_message_name) \
(__proto_message_name ##__get_packed_size(__obj) + sizeof(u32))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment