diff --git a/protobuf-c/protobuf-c.c b/protobuf-c/protobuf-c.c index aff3526..7e0fad1 100644 --- a/protobuf-c/protobuf-c.c +++ b/protobuf-c/protobuf-c.c @@ -84,7 +84,9 @@ # define PROTOBUF_C_UNPACK_ERROR(...) #endif +#if !defined(_WIN32) || !defined(PROTOBUF_C_USE_SHARED_LIB) const char protobuf_c_empty_string[] = ""; +#endif /** * Internal `ProtobufCMessage` manipulation macro. diff --git a/protobuf-c/protobuf-c.h b/protobuf-c/protobuf-c.h index da6cf67..92db99b 100755 --- a/protobuf-c/protobuf-c.h +++ b/protobuf-c/protobuf-c.h @@ -238,7 +238,11 @@ PROTOBUF_C__BEGIN_DECLS #define PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC 0x114315af /* Empty string used for initializers */ +#if defined(_WIN32) && defined(PROTOBUF_C_USE_SHARED_LIB) +static const char protobuf_c_empty_string[] = ""; +#else extern const char protobuf_c_empty_string[]; +#endif /** * \defgroup api Public API