From fbaaef999ba563838ebd00874ed8a1c01fbf286d Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Thu, 27 May 2010 16:25:37 -0700 Subject: Add protobuf 2.2.0a sources This is the contents of protobuf-2.2.0a.tar.bz2 from http://code.google.com/p/protobuf/downloads/list and is the base code for the javamicro code generator. Change-Id: Ie9a0440a824d615086445b6636944484b3155afa --- vsprojects/config.h | 25 ++ vsprojects/convert2008to2005.sh | 20 ++ vsprojects/extract_includes.bat | 42 +++ vsprojects/libprotobuf-lite.vcproj | 270 +++++++++++++++++ vsprojects/libprotobuf.vcproj | 430 ++++++++++++++++++++++++++++ vsprojects/libprotoc.vcproj | 374 ++++++++++++++++++++++++ vsprojects/lite-test.vcproj | 273 ++++++++++++++++++ vsprojects/protobuf.sln | 80 ++++++ vsprojects/protoc.vcproj | 192 +++++++++++++ vsprojects/readme.txt | 114 ++++++++ vsprojects/tests.vcproj | 573 +++++++++++++++++++++++++++++++++++++ 11 files changed, 2393 insertions(+) create mode 100644 vsprojects/config.h create mode 100755 vsprojects/convert2008to2005.sh create mode 100755 vsprojects/extract_includes.bat create mode 100644 vsprojects/libprotobuf-lite.vcproj create mode 100644 vsprojects/libprotobuf.vcproj create mode 100644 vsprojects/libprotoc.vcproj create mode 100644 vsprojects/lite-test.vcproj create mode 100644 vsprojects/protobuf.sln create mode 100644 vsprojects/protoc.vcproj create mode 100644 vsprojects/readme.txt create mode 100644 vsprojects/tests.vcproj (limited to 'vsprojects') diff --git a/vsprojects/config.h b/vsprojects/config.h new file mode 100644 index 0000000..e09f297 --- /dev/null +++ b/vsprojects/config.h @@ -0,0 +1,25 @@ +/* protobuf config.h for MSVC. On other platforms, this is generated + * automatically by autoheader / autoconf / configure. */ + +/* the location of */ +#define HASH_MAP_H + +/* the namespace of hash_map/hash_set */ +#if _MSC_VER < 1310 +#define HASH_NAMESPACE std +#else +#define HASH_NAMESPACE stdext +#endif + +/* the location of */ +#define HASH_SET_H + +/* define if the compiler has hash_map */ +#define HAVE_HASH_MAP 1 + +/* define if the compiler has hash_set */ +#define HAVE_HASH_SET 1 + +/* define if you want to use zlib. See readme.txt for additional + * requirements. */ +// #define HAVE_ZLIB 1 diff --git a/vsprojects/convert2008to2005.sh b/vsprojects/convert2008to2005.sh new file mode 100755 index 0000000..60eccaf --- /dev/null +++ b/vsprojects/convert2008to2005.sh @@ -0,0 +1,20 @@ +#! /bin/sh -e + +# This script downgrades MSVC 2008 projects to MSVC 2005 projects, allowing +# people with MSVC 2005 to open them. Otherwise, MSVC 2005 simply refuses to +# open projects created with 2008. We run this as part of our release process. +# If you obtained the code direct from version control and you want to use +# MSVC 2005, you may have to run this manually. (Hint: Use Cygwin or MSYS.) + +for file in *.sln; do + echo "downgrading $file..." + sed -i -re 's/Format Version 10.00/Format Version 9.00/g; + s/Visual Studio 2008/Visual Studio 2005/g;' $file +done + +for file in *.vcproj; do + echo "downgrading $file..." + sed -i -re 's/Version="9.00"/Version="8.00"/g;' $file +done + +# Yes, really, that's it. diff --git a/vsprojects/extract_includes.bat b/vsprojects/extract_includes.bat new file mode 100755 index 0000000..5e513d7 --- /dev/null +++ b/vsprojects/extract_includes.bat @@ -0,0 +1,42 @@ +md include +md include\google +md include\google\protobuf +md include\google\protobuf\stubs +md include\google\protobuf\io +md include\google\protobuf\compiler +md include\google\protobuf\compiler\cpp +md include\google\protobuf\compiler\java +md include\google\protobuf\compiler\python +copy ..\src\google\protobuf\stubs\common.h include\google\protobuf\stubs\common.h +copy ..\src\google\protobuf\stubs\once.h include\google\protobuf\stubs\once.h +copy ..\src\google\protobuf\descriptor.h include\google\protobuf\descriptor.h +copy ..\src\google\protobuf\descriptor.pb.h include\google\protobuf\descriptor.pb.h +copy ..\src\google\protobuf\descriptor_database.h include\google\protobuf\descriptor_database.h +copy ..\src\google\protobuf\dynamic_message.h include\google\protobuf\dynamic_message.h +copy ..\src\google\protobuf\extension_set.h include\google\protobuf\extension_set.h +copy ..\src\google\protobuf\generated_message_util.h include\google\protobuf\generated_message_util.h +copy ..\src\google\protobuf\generated_message_reflection.h include\google\protobuf\generated_message_reflection.h +copy ..\src\google\protobuf\message.h include\google\protobuf\message.h +copy ..\src\google\protobuf\message_lite.h include\google\protobuf\message_lite.h +copy ..\src\google\protobuf\reflection_ops.h include\google\protobuf\reflection_ops.h +copy ..\src\google\protobuf\repeated_field.h include\google\protobuf\repeated_field.h +copy ..\src\google\protobuf\service.h include\google\protobuf\service.h +copy ..\src\google\protobuf\text_format.h include\google\protobuf\text_format.h +copy ..\src\google\protobuf\unknown_field_set.h include\google\protobuf\unknown_field_set.h +copy ..\src\google\protobuf\wire_format.h include\google\protobuf\wire_format.h +copy ..\src\google\protobuf\wire_format_lite.h include\google\protobuf\wire_format_lite.h +copy ..\src\google\protobuf\wire_format_lite_inl.h include\google\protobuf\wire_format_lite_inl.h +copy ..\src\google\protobuf\io\coded_stream.h include\google\protobuf\io\coded_stream.h +copy ..\src\google\protobuf\io\gzip_stream.h include\google\protobuf\io\gzip_stream.h +copy ..\src\google\protobuf\io\printer.h include\google\protobuf\io\printer.h +copy ..\src\google\protobuf\io\tokenizer.h include\google\protobuf\io\tokenizer.h +copy ..\src\google\protobuf\io\zero_copy_stream.h include\google\protobuf\io\zero_copy_stream.h +copy ..\src\google\protobuf\io\zero_copy_stream_impl.h include\google\protobuf\io\zero_copy_stream_impl.h +copy ..\src\google\protobuf\io\zero_copy_stream_impl_lite.h include\google\protobuf\io\zero_copy_stream_impl_lite.h +copy ..\src\google\protobuf\compiler\code_generator.h include\google\protobuf\compiler\code_generator.h +copy ..\src\google\protobuf\compiler\command_line_interface.h include\google\protobuf\compiler\command_line_interface.h +copy ..\src\google\protobuf\compiler\importer.h include\google\protobuf\compiler\importer.h +copy ..\src\google\protobuf\compiler\parser.h include\google\protobuf\compiler\parser.h +copy ..\src\google\protobuf\compiler\cpp\cpp_generator.h include\google\protobuf\compiler\cpp\cpp_generator.h +copy ..\src\google\protobuf\compiler\java\java_generator.h include\google\protobuf\compiler\java\java_generator.h +copy ..\src\google\protobuf\compiler\python\python_generator.h include\google\protobuf\compiler\python\python_generator.h diff --git a/vsprojects/libprotobuf-lite.vcproj b/vsprojects/libprotobuf-lite.vcproj new file mode 100644 index 0000000..b373e75 --- /dev/null +++ b/vsprojects/libprotobuf-lite.vcproj @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsprojects/libprotobuf.vcproj b/vsprojects/libprotobuf.vcproj new file mode 100644 index 0000000..df5b675 --- /dev/null +++ b/vsprojects/libprotobuf.vcproj @@ -0,0 +1,430 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsprojects/libprotoc.vcproj b/vsprojects/libprotoc.vcproj new file mode 100644 index 0000000..abbb386 --- /dev/null +++ b/vsprojects/libprotoc.vcproj @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsprojects/lite-test.vcproj b/vsprojects/lite-test.vcproj new file mode 100644 index 0000000..be8e941 --- /dev/null +++ b/vsprojects/lite-test.vcproj @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsprojects/protobuf.sln b/vsprojects/protobuf.sln new file mode 100644 index 0000000..d17546c --- /dev/null +++ b/vsprojects/protobuf.sln @@ -0,0 +1,80 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libprotobuf", "libprotobuf.vcproj", "{3E283F37-A4ED-41B7-A3E6-A2D89D131A30}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libprotoc", "libprotoc.vcproj", "{B84FF31A-5F9A-46F8-AB22-DBFC9BECE3BE}" + ProjectSection(ProjectDependencies) = postProject + {3E283F37-A4ED-41B7-A3E6-A2D89D131A30} = {3E283F37-A4ED-41B7-A3E6-A2D89D131A30} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "protoc", "protoc.vcproj", "{1738D5F6-ED1E-47E0-B2F0-456864B93C1E}" + ProjectSection(ProjectDependencies) = postProject + {B84FF31A-5F9A-46F8-AB22-DBFC9BECE3BE} = {B84FF31A-5F9A-46F8-AB22-DBFC9BECE3BE} + {3E283F37-A4ED-41B7-A3E6-A2D89D131A30} = {3E283F37-A4ED-41B7-A3E6-A2D89D131A30} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests.vcproj", "{4DF72760-C055-40A5-A77E-30A17E2AC2DB}" + ProjectSection(ProjectDependencies) = postProject + {B84FF31A-5F9A-46F8-AB22-DBFC9BECE3BE} = {B84FF31A-5F9A-46F8-AB22-DBFC9BECE3BE} + {3E283F37-A4ED-41B7-A3E6-A2D89D131A30} = {3E283F37-A4ED-41B7-A3E6-A2D89D131A30} + {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7} = {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7} + {3AF54C8A-10BF-4332-9147-F68ED9862032} = {3AF54C8A-10BF-4332-9147-F68ED9862032} + {1738D5F6-ED1E-47E0-B2F0-456864B93C1E} = {1738D5F6-ED1E-47E0-B2F0-456864B93C1E} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "..\gtest\msvc\gtest.vcproj", "{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest_main", "..\gtest\msvc\gtest_main.vcproj", "{3AF54C8A-10BF-4332-9147-F68ED9862032}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libprotobuf-lite", "libprotobuf-lite.vcproj", "{49EA010D-706F-4BE2-A397-77854B72A040}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lite-test", "lite-test.vcproj", "{12015ACE-42BE-4952-A5A0-44A9A46908E2}" + ProjectSection(ProjectDependencies) = postProject + {49EA010D-706F-4BE2-A397-77854B72A040} = {49EA010D-706F-4BE2-A397-77854B72A040} + {1738D5F6-ED1E-47E0-B2F0-456864B93C1E} = {1738D5F6-ED1E-47E0-B2F0-456864B93C1E} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.Debug|Win32.ActiveCfg = Debug|Win32 + {3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.Debug|Win32.Build.0 = Debug|Win32 + {3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.Release|Win32.ActiveCfg = Release|Win32 + {3E283F37-A4ED-41B7-A3E6-A2D89D131A30}.Release|Win32.Build.0 = Release|Win32 + {B84FF31A-5F9A-46F8-AB22-DBFC9BECE3BE}.Debug|Win32.ActiveCfg = Debug|Win32 + {B84FF31A-5F9A-46F8-AB22-DBFC9BECE3BE}.Debug|Win32.Build.0 = Debug|Win32 + {B84FF31A-5F9A-46F8-AB22-DBFC9BECE3BE}.Release|Win32.ActiveCfg = Release|Win32 + {B84FF31A-5F9A-46F8-AB22-DBFC9BECE3BE}.Release|Win32.Build.0 = Release|Win32 + {1738D5F6-ED1E-47E0-B2F0-456864B93C1E}.Debug|Win32.ActiveCfg = Debug|Win32 + {1738D5F6-ED1E-47E0-B2F0-456864B93C1E}.Debug|Win32.Build.0 = Debug|Win32 + {1738D5F6-ED1E-47E0-B2F0-456864B93C1E}.Release|Win32.ActiveCfg = Release|Win32 + {1738D5F6-ED1E-47E0-B2F0-456864B93C1E}.Release|Win32.Build.0 = Release|Win32 + {4DF72760-C055-40A5-A77E-30A17E2AC2DB}.Debug|Win32.ActiveCfg = Debug|Win32 + {4DF72760-C055-40A5-A77E-30A17E2AC2DB}.Debug|Win32.Build.0 = Debug|Win32 + {4DF72760-C055-40A5-A77E-30A17E2AC2DB}.Release|Win32.ActiveCfg = Release|Win32 + {4DF72760-C055-40A5-A77E-30A17E2AC2DB}.Release|Win32.Build.0 = Release|Win32 + {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug|Win32.ActiveCfg = Debug|Win32 + {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Debug|Win32.Build.0 = Debug|Win32 + {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release|Win32.ActiveCfg = Release|Win32 + {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}.Release|Win32.Build.0 = Release|Win32 + {3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug|Win32.ActiveCfg = Debug|Win32 + {3AF54C8A-10BF-4332-9147-F68ED9862032}.Debug|Win32.Build.0 = Debug|Win32 + {3AF54C8A-10BF-4332-9147-F68ED9862032}.Release|Win32.ActiveCfg = Release|Win32 + {3AF54C8A-10BF-4332-9147-F68ED9862032}.Release|Win32.Build.0 = Release|Win32 + {49EA010D-706F-4BE2-A397-77854B72A040}.Debug|Win32.ActiveCfg = Debug|Win32 + {49EA010D-706F-4BE2-A397-77854B72A040}.Debug|Win32.Build.0 = Debug|Win32 + {49EA010D-706F-4BE2-A397-77854B72A040}.Release|Win32.ActiveCfg = Release|Win32 + {49EA010D-706F-4BE2-A397-77854B72A040}.Release|Win32.Build.0 = Release|Win32 + {12015ACE-42BE-4952-A5A0-44A9A46908E2}.Debug|Win32.ActiveCfg = Debug|Win32 + {12015ACE-42BE-4952-A5A0-44A9A46908E2}.Debug|Win32.Build.0 = Debug|Win32 + {12015ACE-42BE-4952-A5A0-44A9A46908E2}.Release|Win32.ActiveCfg = Release|Win32 + {12015ACE-42BE-4952-A5A0-44A9A46908E2}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/vsprojects/protoc.vcproj b/vsprojects/protoc.vcproj new file mode 100644 index 0000000..a0ca63e --- /dev/null +++ b/vsprojects/protoc.vcproj @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsprojects/readme.txt b/vsprojects/readme.txt new file mode 100644 index 0000000..288345a --- /dev/null +++ b/vsprojects/readme.txt @@ -0,0 +1,114 @@ +This directory contains project files for compiling Protocol Buffers using +MSVC. This is not the recommended way to do Protocol Buffer development -- +we prefer to develop under a Unix-like environment -- but it may be more +accessible to those who primarily work with MSVC. + +Compiling and Installing +======================== + +1) Open protobuf.sln in Microsoft Visual Studio. +2) Choose "Debug" or "Release" configuration as desired.* +3) From the Build menu, choose "Build Solution". Wait for compiling to finish. +4) From a command shell, run tests.exe and lite-test.exe and check that all + tests pass. +5) Run extract_includes.bat to copy all the public headers into a separate + "include" directory (under the top-level package directory). +6) Copy the contents of the include directory to wherever you want to put + headers. +7) Copy protoc.exe wherever you put build tools (probably somewhere in your + PATH). +8) Copy libprotobuf.lib, libprotobuf-lite.lib, and libprotoc.lib wherever you + put libraries. + +* To avoid conflicts between the MSVC debug and release runtime libraries, when + compiling a debug build of your application, you may need to link against a + debug build of libprotobuf.lib. Similarly, release builds should link against + release libs. + +DLLs vs. static linking +======================= + +Static linking is now the default for the Protocol Buffer libraries. Due to +issues with Win32's use of a separate heap for each DLL, as well as binary +compatibility issues between different versions of MSVC's STL library, it is +recommended that you use static linkage only. However, it is possible to +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, 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)". + 2d) From the side bar, choose "Preprocessor", under "C/C++". + 2e) Add PROTOBUF_USE_DLLS to the list of preprocessor defines. + 3) When compiling your project, make sure to #define PROTOBUF_USE_DLLS. + +When distributing your software to end users, we strongly recommend that you +do NOT install libprotobuf.dll or libprotoc.dll to any shared location. +Instead, keep these libraries next to your binaries, in your application's +own install directory. C++ makes it very difficult to maintain binary +compatibility between releases, so it is likely that future versions of these +libraries will *not* be usable as drop-in replacements. + +If your project is itself a DLL intended for use by third-party software, we +recommend that you do NOT expose protocol buffer objects in your library's +public interface, and that you statically link protocol buffers into your +library. + +ZLib support +============ + +If you want to include GzipInputStream and GzipOutputStream +(google/protobuf/io/gzip_stream.h) in libprotoc, you will need to do a few +additional steps: + +1) Obtain a copy of the zlib library. The pre-compiled DLL at zlib.net works. +2) Make sure zlib's two headers are in your include path and that the .lib file + is in your library path. You could place all three files directly into the + vsproject directory to compile libprotobuf, but they need to be visible to + your own project as well, so you should probably just put them into the + VC shared icnlude and library directories. +3) Right-click on the "tests" project and choose "properties". Navigate the + sidebar to "Configuration Properties" -> "Linker" -> "Input". +4) Under "Additional Dependencies", add the name of the zlib .lib file (e.g. + zdll.lib). Make sure to update both the Debug and Release configurations. +5) If you are compiling libprotobuf and libprotoc as DLLs (see previous + section), repeat steps 2 and 3 for the libprotobuf and libprotoc projects. + If you are compiling them as static libraries, then you will need to link + against the zlib library directly from your own app. +6) Edit config.h (in the vsprojects directory) and un-comment the line that + #defines HAVE_ZLIB. (Or, alternatively, define this macro via the project + settings.) + +Notes on Compiler Warnings +========================== + +The following warnings have been disabled while building the protobuf libraries +and compiler. You may have to disable some of them in your own project as +well, or live with them. + +C4018 - 'expression' : signed/unsigned mismatch +C4146 - unary minus operator applied to unsigned type, result still unsigned +C4244 - Conversion from 'type1' to 'type2', possible loss of data. +C4251 - 'identifier' : class 'type' needs to have dll-interface to be used by + clients of class 'type2' +C4267 - Conversion from 'size_t' to 'type', possible loss of data. +C4305 - 'identifier' : truncation from 'type1' to 'type2' +C4355 - 'this' : used in base member initializer list +C4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning) +C4996 - 'function': was declared deprecated + +C4251 is of particular note, if you are compiling the Protocol Buffer library +as a DLL (see previous section). The protocol buffer library uses templates in +its public interfaces. MSVC does not provide any reasonable way to export +template classes from a DLL. However, in practice, it appears that exporting +templates is not necessary anyway. Since the complete definition of any +template is available in the header files, anyone importing the DLL will just +end up compiling instances of the templates into their own binary. The +Protocol Buffer implementation does not rely on static template members being +unique, so there should be no problem with this, but MSVC prints warning +nevertheless. So, we disable it. Unfortunately, this warning will also be +produced when compiling code which merely uses protocol buffers, meaning you +may have to disable it in your code too. diff --git a/vsprojects/tests.vcproj b/vsprojects/tests.vcproj new file mode 100644 index 0000000..cd40b60 --- /dev/null +++ b/vsprojects/tests.vcproj @@ -0,0 +1,573 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.1