Sha256: a9469e118335730a2d4ba6a0317abf3accb1cbce9b201c5d4cafe293629000ec

Contents?: true

Size: 1.01 KB

Versions: 307

Compression:

Stored size: 1.01 KB

Contents

// Protocol Buffers - Google's data interchange format
// Copyright 2017 Google Inc.  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

#include <string.h>

// On x86-64 Linux with glibc, we link against the 2.2.5 version of memcpy so
// that we avoid depending on the 2.14 version of the symbol. This way,
// distributions that are using pre-2.14 versions of glibc can successfully use
// the gem we distribute
// (https://github.com/protocolbuffers/protobuf/issues/2783).
//
// This wrapper is enabled by passing the linker flags -Wl,-wrap,memcpy in
// extconf.rb.
#ifdef __linux__
#if defined(__x86_64__) && defined(__GNU_LIBRARY__)
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
void *__wrap_memcpy(void *dest, const void *src, size_t n) {
  return memcpy(dest, src, n);
}
#else
void *__wrap_memcpy(void *dest, const void *src, size_t n) {
  return memmove(dest, src, n);
}
#endif
#endif

Version data entries

307 entries across 307 versions & 2 rubygems

Version Path
google-protobuf-4.29.0-x86-mingw32 ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0-x86-linux ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0-x64-mingw32 ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0-x64-mingw-ucrt ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0-arm64-darwin ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0-aarch64-linux ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.3 ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.3-x86_64-linux ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.3-x86_64-darwin ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.3-x86-mingw32 ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.3-x86-linux ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.3-x64-mingw32 ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.3-x64-mingw-ucrt ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.3-arm64-darwin ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.3-aarch64-linux ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.2 ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.2-x86_64-linux ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.2-x86_64-darwin ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.2-x86-mingw32 ext/google/protobuf_c/wrap_memcpy.c
google-protobuf-4.29.0.rc.2-x86-linux ext/google/protobuf_c/wrap_memcpy.c