mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
Besides unnecessary inconsistency on our C symbols, double underscores anywhere in the name are reserved for stdlib use. In practice its unlikely these symbols would ever hit a collision problem (maybe the prior name 'utf8_debug_string' with no prefix as having some risk), but safer to just standardize on this and have no concerns going forward. PiperOrigin-RevId: 648709299
39 lines
1.8 KiB
C++
39 lines
1.8 KiB
C++
#include "rust/cpp_kernel/map.h"
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
#include "google/protobuf/map.h"
|
|
#include "rust/cpp_kernel/strings.h"
|
|
|
|
extern "C" {
|
|
|
|
void rust_proto_thunk_UntypedMapIterator_increment(
|
|
google::protobuf::internal::UntypedMapIterator* iter) {
|
|
iter->PlusPlus();
|
|
}
|
|
|
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(int32_t, i32, int32_t, value,
|
|
cpp_value);
|
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(uint32_t, u32, uint32_t,
|
|
value, cpp_value);
|
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(float, f32, float, value,
|
|
cpp_value);
|
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(double, f64, double, value,
|
|
cpp_value);
|
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(bool, bool, bool, value,
|
|
cpp_value);
|
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(uint64_t, u64, uint64_t,
|
|
value, cpp_value);
|
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(int64_t, i64, int64_t, value,
|
|
cpp_value);
|
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(
|
|
std::string, ProtoBytes, google::protobuf::rust_internal::PtrAndLen,
|
|
std::string(value.ptr, value.len),
|
|
google::protobuf::rust_internal::PtrAndLen(cpp_value.data(), cpp_value.size()));
|
|
__PB_RUST_EXPOSE_SCALAR_MAP_METHODS_FOR_VALUE_TYPE(
|
|
std::string, ProtoString, google::protobuf::rust_internal::PtrAndLen,
|
|
std::string(value.ptr, value.len),
|
|
google::protobuf::rust_internal::PtrAndLen(cpp_value.data(), cpp_value.size()));
|
|
|
|
} // extern "C"
|