Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
protobuf-c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
protobuf-c
Commits
c96fee16
Commit
c96fee16
authored
Jun 04, 2014
by
Robert Edmonds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PROTOBUF_C_OFFSETOF -> offsetof
offsetof() conforms to the C89 standard, just call it directly.
parent
a1fa70c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
protobuf-c/protobuf-c.h
protobuf-c/protobuf-c.h
+0
-2
protoc-c/c_field.cc
protoc-c/c_field.cc
+3
-3
No files found.
protobuf-c/protobuf-c.h
View file @
c96fee16
...
...
@@ -53,8 +53,6 @@
# define PROTOBUF_C_DEPRECATED
#endif
#define PROTOBUF_C_OFFSETOF(struct, member) offsetof(struct, member)
#if defined(_WIN32) && defined(PROTOBUF_C_USE_SHARED_LIB)
# ifdef PROTOBUF_C_EXPORT
# define PROTOBUF_C_API __declspec(dllexport)
...
...
protoc-c/c_field.cc
View file @
c96fee16
...
...
@@ -145,16 +145,16 @@ void FieldGenerator::GenerateDescriptorInitializerGeneric(io::Printer* printer,
break
;
case
FieldDescriptor
:
:
LABEL_OPTIONAL
:
if
(
optional_uses_has
)
{
printer
->
Print
(
variables
,
"
PROTOBUF_C_OFFSETOF
($classname$, has_$name$),
\n
"
);
printer
->
Print
(
variables
,
"
offsetof
($classname$, has_$name$),
\n
"
);
}
else
{
printer
->
Print
(
variables
,
" 0, /* quantifier_offset */
\n
"
);
}
break
;
case
FieldDescriptor
:
:
LABEL_REPEATED
:
printer
->
Print
(
variables
,
"
PROTOBUF_C_OFFSETOF
($classname$, n_$name$),
\n
"
);
printer
->
Print
(
variables
,
"
offsetof
($classname$, n_$name$),
\n
"
);
break
;
}
printer
->
Print
(
variables
,
"
PROTOBUF_C_OFFSETOF
($classname$, $name$),
\n
"
);
printer
->
Print
(
variables
,
"
offsetof
($classname$, $name$),
\n
"
);
printer
->
Print
(
variables
,
" $descriptor_addr$,
\n
"
);
printer
->
Print
(
variables
,
" $default_value$,
\n
"
);
printer
->
Print
(
variables
,
" $flags$, /* flags */
\n
"
);
...
...
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