Sha256: 9da42cf3cc254ba14a236279d08fcc295f85bc1287bed2d38f25c3062f7fd048

Contents?: true

Size: 820 Bytes

Versions: 13

Compression:

Stored size: 820 Bytes

Contents

// Protocol Buffers - Google's data interchange format
// Copyright 2023 Google LLC.  All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd

#ifndef UPB_BASE_UPCAST_H_
#define UPB_BASE_UPCAST_H_

// Must be last.
#include "upb/port/def.inc"

// This macro provides a way to upcast message pointers in a way that is
// somewhat more bulletproof than blindly casting a pointer. Example:
//
// typedef struct {
//   upb_Message UPB_PRIVATE(base);
// } pkg_FooMessage;
//
// void f(pkg_FooMessage* msg) {
//   upb_Decode(UPB_UPCAST(msg), ...);
// }

#define UPB_UPCAST(x) (&(x)->base##_dont_copy_me__upb_internal_use_only)

#include "upb/port/undef.inc"

#endif /* UPB_BASE_UPCAST_H_ */

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
grpc-1.67.0 third_party/upb/upb/base/upcast.h
grpc-1.67.0.pre1 third_party/upb/upb/base/upcast.h
grpc-1.66.0 third_party/upb/upb/base/upcast.h
grpc-1.66.0.pre5 third_party/upb/upb/base/upcast.h
grpc-1.66.0.pre3 third_party/upb/upb/base/upcast.h
grpc-1.63.2 third_party/upb/upb/base/upcast.h
grpc-1.64.3 third_party/upb/upb/base/upcast.h
grpc-1.65.2 third_party/upb/upb/base/upcast.h
grpc-1.65.1 third_party/upb/upb/base/upcast.h
grpc-1.65.0 third_party/upb/upb/base/upcast.h
grpc-1.65.0.pre2 third_party/upb/upb/base/upcast.h
grpc-1.65.0.pre1 third_party/upb/upb/base/upcast.h
grpc-1.63.0 third_party/upb/upb/base/upcast.h