码迷,mamicode.com
首页 > 其他好文 > 详细

protocol buffer如何将输出文件编译为DLL

时间:2018-01-29 20:21:55      阅读:529      评论:0      收藏:0      [点我收藏+]

标签:imp   std   markdown   dep   tps   rip   dllimport   ring   mac   

https://github.com/google/protobuf/blob/master/src/google/protobuf/compiler/cpp/cpp_generator.cc

bool CppGenerator::Generate(const FileDescriptor* file,
const string& parameter,
GeneratorContext* generator_context,
string* error) const {
std::vector<std::pair<string, string> > options;
ParseGeneratorParameter(parameter, &options);
// -----------------------------------------------------------------
// parse generator options
// TODO(kenton): If we ever have more options, we may want to create a
// class that encapsulates them which we can pass down to all the
// generator classes. Currently we pass dllexport_decl down to all of
// them via the constructors, but we don‘t want to have to add another
// constructor parameter for every option.
// If the dllexport_decl option is passed to the compiler, we need to write
// it in front of every symbol that should be exported if this .proto is
// compiled into a Windows DLL. E.g., if the user invokes the protocol
// compiler as:
// protoc --cpp_out=dllexport_decl=FOO_EXPORT:outdir foo.proto
// then we‘ll define classes like this:
// class FOO_EXPORT Foo {
// ...
// }
// FOO_EXPORT is a macro which should expand to __declspec(dllexport) or
// __declspec(dllimport) depending on what is being compiled.
//

protocol buffer如何将输出文件编译为DLL

标签:imp   std   markdown   dep   tps   rip   dllimport   ring   mac   

原文地址:https://www.cnblogs.com/zhongpan/p/8378825.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!