Sha256: 98c79ed21e8aed9c7fbb3505f40627f41d695a73f4efb70f00d9102ea2e8ddda

Contents?: true

Size: 972 Bytes

Versions: 26

Compression:

Stored size: 972 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_PORT_VSNPRINTF_COMPAT_H_
#define UPB_PORT_VSNPRINTF_COMPAT_H_

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

UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt,
                              va_list ap) {
#if defined(__MINGW64__) || defined(__MINGW32__) || defined(_MSC_VER)
  // The msvc runtime has a non-conforming vsnprintf() that requires the
  // following compatibility code to become conformant.
  int n = -1;
  if (size != 0) n = _vsnprintf_s(buf, size, _TRUNCATE, fmt, ap);
  if (n == -1) n = _vscprintf(fmt, ap);
  return n;
#else
  return vsnprintf(buf, size, fmt, ap);
#endif
}

#include "upb/port/undef.inc"

#endif  // UPB_PORT_VSNPRINTF_COMPAT_H_

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
grpc-1.70.1 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.69.0 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.69.0.pre1 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.68.1 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.67.0 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.67.0.pre1 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.66.0 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.66.0.pre5 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.66.0.pre3 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.60.2 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.61.3 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.62.3 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.63.2 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.64.3 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.65.2 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.65.1 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.65.0 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.65.0.pre2 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.65.0.pre1 third_party/upb/upb/port/vsnprintf_compat.h
grpc-1.63.0 third_party/upb/upb/port/vsnprintf_compat.h