Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
9270a99d
Commit
9270a99d
authored
Aug 01, 2009
by
kenton@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make DLLs work again.
parent
e6607e39
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
7 deletions
+18
-7
lite_unittest.cc
src/google/protobuf/lite_unittest.cc
+1
-1
repeated_field.cc
src/google/protobuf/repeated_field.cc
+2
-2
repeated_field.h
src/google/protobuf/repeated_field.h
+13
-2
wire_format_lite.cc
src/google/protobuf/wire_format_lite.cc
+0
-1
readme.txt
vsprojects/readme.txt
+2
-1
No files found.
src/google/protobuf/lite_unittest.cc
View file @
9270a99d
...
...
@@ -107,6 +107,6 @@ int main(int argc, char* argv[]) {
google
::
protobuf
::
TestUtilLite
::
ExpectPackedExtensionsClear
(
message
);
}
cout
<<
"PASS"
;
cout
<<
"PASS"
<<
endl
;
return
0
;
}
src/google/protobuf/repeated_field.cc
View file @
9270a99d
...
...
@@ -69,10 +69,10 @@ void RepeatedPtrFieldBase::Swap(RepeatedPtrFieldBase* other) {
}
}
string
*
StringTypeHandler
::
New
()
{
string
*
StringTypeHandler
Base
::
New
()
{
return
new
string
;
}
void
StringTypeHandler
::
Delete
(
string
*
value
)
{
void
StringTypeHandler
Base
::
Delete
(
string
*
value
)
{
delete
value
;
}
...
...
src/google/protobuf/repeated_field.h
View file @
9270a99d
...
...
@@ -262,19 +262,30 @@ inline void GenericTypeHandler<MessageLite>::Merge(
to
->
CheckTypeAndMergeFrom
(
from
);
}
class
LIBPROTOBUF_EXPORT
StringTypeHandler
{
// HACK: If a class is declared as DLL-exported in MSVC, it insists on
// generating copies of all its methods -- even inline ones -- to include
// in the DLL. But SpaceUsed() calls StringSpaceUsedExcludingSelf() which
// isn't in the lite library, therefore the lite library cannot link if
// StringTypeHandler is exported. So, we factor out StringTypeHandlerBase,
// export that, then make StringTypeHandler be a subclass which is NOT
// exported.
// TODO(kenton): There has to be a better way.
class
LIBPROTOBUF_EXPORT
StringTypeHandlerBase
{
public
:
typedef
string
Type
;
static
string
*
New
();
static
void
Delete
(
string
*
value
);
static
void
Clear
(
string
*
value
)
{
value
->
clear
();
}
static
void
Merge
(
const
string
&
from
,
string
*
to
)
{
*
to
=
from
;
}
};
class
StringTypeHandler
:
public
StringTypeHandlerBase
{
public
:
static
int
SpaceUsed
(
const
string
&
value
)
{
return
sizeof
(
value
)
+
StringSpaceUsedExcludingSelf
(
value
);
}
};
}
// namespace internal
// RepeatedPtrField is like RepeatedField, but used for repeated strings or
...
...
src/google/protobuf/wire_format_lite.cc
View file @
9270a99d
...
...
@@ -42,7 +42,6 @@
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include <google/protobuf/unknown_field_set.h>
namespace
google
{
namespace
protobuf
{
...
...
vsprojects/readme.txt
View file @
9270a99d
...
...
@@ -36,7 +36,8 @@ build libprotobuf and libprotoc as DLLs if you really want. To do this,
do the following:
1) Open protobuf.sln in MSVC.
2) For each of the projects libprotobuf and libprotoc, do the following:
2) For each of the projects libprotobuf, libprotobuf-lite, and libprotoc, do
the following:
2a) Right-click the project and choose "properties".
2b) From the side bar, choose "General", under "Configuration Properties".
2c) Change the "Configuration Type" to "Dynamic Library (.dll)".
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment