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
spbro
protobuf-c
Commits
b28683f8
Commit
b28683f8
authored
Feb 08, 2025
by
Robert Edmonds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
protoc-gen-c/c_helpers.h: Move compat defines into new header file compat.h
parent
185beed2
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
10 deletions
+51
-10
protoc-gen-c/c_field.cc
protoc-gen-c/c_field.cc
+1
-0
protoc-gen-c/c_helpers.cc
protoc-gen-c/c_helpers.cc
+1
-0
protoc-gen-c/c_helpers.h
protoc-gen-c/c_helpers.h
+0
-10
protoc-gen-c/c_message.cc
protoc-gen-c/c_message.cc
+1
-0
protoc-gen-c/c_primitive_field.cc
protoc-gen-c/c_primitive_field.cc
+1
-0
protoc-gen-c/compat.h
protoc-gen-c/compat.h
+46
-0
protoc-gen-c/main.cc
protoc-gen-c/main.cc
+1
-0
No files found.
protoc-gen-c/c_field.cc
View file @
b28683f8
...
@@ -74,6 +74,7 @@
...
@@ -74,6 +74,7 @@
#include "c_message_field.h"
#include "c_message_field.h"
#include "c_primitive_field.h"
#include "c_primitive_field.h"
#include "c_string_field.h"
#include "c_string_field.h"
#include "compat.h"
namespace
protobuf_c
{
namespace
protobuf_c
{
...
...
protoc-gen-c/c_helpers.cc
View file @
b28683f8
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/common.h>
#include "c_helpers.h"
#include "c_helpers.h"
#include "compat.h"
namespace
protobuf_c
{
namespace
protobuf_c
{
...
...
protoc-gen-c/c_helpers.h
View file @
b28683f8
...
@@ -186,16 +186,6 @@ inline int FieldSyntax(const google::protobuf::FieldDescriptor* field) {
...
@@ -186,16 +186,6 @@ inline int FieldSyntax(const google::protobuf::FieldDescriptor* field) {
return
2
;
return
2
;
}
}
// Work around changes in protobuf >= 22.x without breaking compilation against
// older protobuf versions.
#if GOOGLE_PROTOBUF_VERSION >= 4022000
# define GOOGLE_ARRAYSIZE ABSL_ARRAYSIZE
# define GOOGLE_CHECK_EQ ABSL_CHECK_EQ
# define GOOGLE_CHECK_EQ ABSL_CHECK_EQ
# define GOOGLE_DCHECK_GE ABSL_DCHECK_GE
# define GOOGLE_LOG ABSL_LOG
#endif
}
// namespace protobuf_c
}
// namespace protobuf_c
#endif // PROTOBUF_C_PROTOC_GEN_C_C_HELPERS_H__
#endif // PROTOBUF_C_PROTOC_GEN_C_C_HELPERS_H__
protoc-gen-c/c_message.cc
View file @
b28683f8
...
@@ -78,6 +78,7 @@
...
@@ -78,6 +78,7 @@
#include "c_extension.h"
#include "c_extension.h"
#include "c_helpers.h"
#include "c_helpers.h"
#include "c_message.h"
#include "c_message.h"
#include "compat.h"
namespace
protobuf_c
{
namespace
protobuf_c
{
...
...
protoc-gen-c/c_primitive_field.cc
View file @
b28683f8
...
@@ -67,6 +67,7 @@
...
@@ -67,6 +67,7 @@
#include "c_helpers.h"
#include "c_helpers.h"
#include "c_primitive_field.h"
#include "c_primitive_field.h"
#include "compat.h"
namespace
protobuf_c
{
namespace
protobuf_c
{
...
...
protoc-gen-c/compat.h
0 → 100644
View file @
b28683f8
// Copyright (c) 2008-2025, Dave Benson and the protobuf-c authors.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef PROTOBUF_C_PROTOC_GEN_C_COMPAT_H__
#define PROTOBUF_C_PROTOC_GEN_C_COMPAT_H__
#if GOOGLE_PROTOBUF_VERSION >= 4022000
# define GOOGLE_ARRAYSIZE ABSL_ARRAYSIZE
# define GOOGLE_CHECK_EQ ABSL_CHECK_EQ
# define GOOGLE_DCHECK_GE ABSL_DCHECK_GE
# define GOOGLE_LOG ABSL_LOG
#endif
namespace
protobuf_c
{
namespace
compat
{
}
// namespace compat
}
// namespace protobuf_c
#endif // PROTOBUF_C_PROTOC_GEN_C_COMPAT_H__
protoc-gen-c/main.cc
View file @
b28683f8
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include "c_generator.h"
#include "c_generator.h"
#include "c_helpers.h"
#include "c_helpers.h"
#include "compat.h"
int
main
(
int
argc
,
char
*
argv
[])
{
int
main
(
int
argc
,
char
*
argv
[])
{
protobuf_c
::
CGenerator
c_generator
;
protobuf_c
::
CGenerator
c_generator
;
...
...
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