dep-protobuf/python/google/protobuf/use_fast_cpp_protos.cc
Hong Shin 547ae49491 internal change
PiperOrigin-RevId: 823205194
2025-10-23 15:13:55 -07:00

46 lines
1.3 KiB
C++

// Protocol Buffers - Google's data interchange format
// Copyright 2021 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
#include <Python.h>
namespace google {
namespace protobuf {
namespace python {
static const char* kModuleName = "_use_fast_cpp_protos";
static const char kModuleDocstring[] =
"The presence of this module in a build's deps signals to\n"
"net.google.protobuf.internal.api_implementation that the fast\n"
"C++ protobuf implementation should be the default.\n";
static struct PyModuleDef _module = {PyModuleDef_HEAD_INIT,
kModuleName,
kModuleDocstring,
-1,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr};
extern "C" {
PyMODINIT_FUNC PyInit__use_fast_cpp_protos() {
PyObject* module = PyModule_Create(&_module);
if (module == nullptr) {
return nullptr;
}
return module;
}
} // extern "C"
} // namespace python
} // namespace protobuf
} // namespace google