From a46d4e81c206785510c61c1ce7638a11e0d6dc6d Mon Sep 17 00:00:00 2001 From: owent Date: Fri, 16 Jun 2023 21:25:09 +0800 Subject: [PATCH] Add dllexport_decl for generated default instance. --- src/google/protobuf/compiler/cpp/file.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/google/protobuf/compiler/cpp/file.cc b/src/google/protobuf/compiler/cpp/file.cc index 708339623527..c19b3aeecea6 100644 --- a/src/google/protobuf/compiler/cpp/file.cc +++ b/src/google/protobuf/compiler/cpp/file.cc @@ -562,7 +562,7 @@ void FileGenerator::GenerateSourceDefaultInstance(int idx, io::Printer* p) { }; }; - PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT$dllexport_decl $ PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const $type$ $name$; )cc"); } @@ -590,7 +590,7 @@ void FileGenerator::GenerateSourceDefaultInstance(int idx, io::Printer* p) { }; }; - PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT$dllexport_decl $ PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 $type$ $name$; )cc"); } else { @@ -609,7 +609,7 @@ void FileGenerator::GenerateSourceDefaultInstance(int idx, io::Printer* p) { }; }; - PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT$dllexport_decl $ PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 $type$ $name$; )cc"); }