diff options
author | Martin Lucina <mato@kotelna.sk> | 2010-02-03 15:54:39 +0100 |
---|---|---|
committer | Martin Lucina <mato@kotelna.sk> | 2010-02-03 15:54:39 +0100 |
commit | 72bbc92b70a67fab1dbba6fbd53f574944bdd8e4 (patch) | |
tree | ec623cb43ace2debbb703c9ec08c41d13205e146 | |
parent | 6502c16a7fd878e61f0672a47e2cdb4d56ab0eb2 (diff) | |
parent | 4172fdd6970d4b42443442bf6633f9a9bd4c6f2b (diff) |
Merge branch 'master' of github.com:sustrik/zeromq2
-rw-r--r-- | builds/msvc/libzmq/libzmq.vcproj | 8 | ||||
-rw-r--r-- | builds/msvc/msvc.sln | 9 | ||||
-rw-r--r-- | builds/msvc/ruby/ruby.vcproj | 68 | ||||
-rw-r--r-- | src/pgm_socket.cpp | 38 |
4 files changed, 105 insertions, 18 deletions
diff --git a/builds/msvc/libzmq/libzmq.vcproj b/builds/msvc/libzmq/libzmq.vcproj index 30de948..3906859 100644 --- a/builds/msvc/libzmq/libzmq.vcproj +++ b/builds/msvc/libzmq/libzmq.vcproj @@ -258,6 +258,10 @@ > </File> <File + RelativePath="..\..\..\src\prefix_tree.cpp" + > + </File> + <File RelativePath="..\..\..\src\pub.cpp" > </File> @@ -512,6 +516,10 @@ > </File> <File + RelativePath="..\..\..\src\prefix_tree.hpp" + > + </File> + <File RelativePath="..\..\..\src\pub.hpp" > </File> diff --git a/builds/msvc/msvc.sln b/builds/msvc/msvc.sln index 95f1299..bd33979 100644 --- a/builds/msvc/msvc.sln +++ b/builds/msvc/msvc.sln @@ -98,6 +98,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zmq_queue", "zmq_queue\zmq_ {641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ruby", "ruby\ruby.vcproj", "{A758A62C-48E3-4C30-ACD2-63AA93391D07}" + ProjectSection(ProjectDependencies) = postProject + {641C5F36-32EE-4323-B740-992B651CF9D6} = {641C5F36-32EE-4323-B740-992B651CF9D6} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -183,6 +188,10 @@ Global {076F7B8B-5175-4CA9-BC2B-438E37F7F43E}.Debug|Win32.Build.0 = Debug|Win32 {076F7B8B-5175-4CA9-BC2B-438E37F7F43E}.Release|Win32.ActiveCfg = Release|Win32 {076F7B8B-5175-4CA9-BC2B-438E37F7F43E}.Release|Win32.Build.0 = Release|Win32 + {A758A62C-48E3-4C30-ACD2-63AA93391D07}.Debug|Win32.ActiveCfg = Debug|Win32 + {A758A62C-48E3-4C30-ACD2-63AA93391D07}.Debug|Win32.Build.0 = Debug|Win32 + {A758A62C-48E3-4C30-ACD2-63AA93391D07}.Release|Win32.ActiveCfg = Release|Win32 + {A758A62C-48E3-4C30-ACD2-63AA93391D07}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/builds/msvc/ruby/ruby.vcproj b/builds/msvc/ruby/ruby.vcproj new file mode 100644 index 0000000..5b38afe --- /dev/null +++ b/builds/msvc/ruby/ruby.vcproj @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9.00" + Name="ruby" + ProjectGUID="{A758A62C-48E3-4C30-ACD2-63AA93391D07}" + RootNamespace="ruby" + TargetFrameworkVersion="196613" + > + <Platforms> + <Platform + Name="Win32" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="10" + CharacterSet="2" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory="$(SolutionDir)$(ConfigurationName)" + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="10" + UseOfMFC="0" + CharacterSet="2" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + CommandLine="cd ..\..\..\bindings\ruby
ruby extconf.rb --with-libzmq-include=".\..\..\bindings\c" --with-libzmq-lib=".\..\..\lib"
nmake
mt.exe -manifest librbzmq.so.manifest -outputresource:librbzmq.so;2
nmake install
cd ..\..\builds\msvc\ruby" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + </Files> + <Globals> + </Globals> +</VisualStudioProject> diff --git a/src/pgm_socket.cpp b/src/pgm_socket.cpp index 4d713e3..8160ca6 100644 --- a/src/pgm_socket.cpp +++ b/src/pgm_socket.cpp @@ -78,33 +78,35 @@ int zmq::pgm_socket_t::init (bool udp_encapsulation_, const char *network_) nbytes_processed = 0; pgm_msgv_processed = 0; + int rc; GError *pgm_error = NULL; - // Init PGM transport. + // Init PGM transport if not already done. // Ensure threading enabled, ensure timer enabled and find PGM protocol id. // // Note that if you want to use gettimeofday and sleep for openPGM timing, // set environment variables PGM_TIMER to "GTOD" // and PGM_SLEEP to "USLEEP". - int rc = pgm_init (&pgm_error); - if (rc != TRUE) { + if (!pgm_supported ()) { + rc = pgm_init (&pgm_error); + if (rc != TRUE) { + if (pgm_error->domain == PGM_IF_ERROR && ( + pgm_error->code == PGM_IF_ERROR_INVAL || + pgm_error->code == PGM_IF_ERROR_XDEV || + pgm_error->code == PGM_IF_ERROR_NODEV || + pgm_error->code == PGM_IF_ERROR_NOTUNIQ || + pgm_error->code == PGM_IF_ERROR_ADDRFAMILY || + pgm_error->code == PGM_IF_ERROR_FAMILY || + pgm_error->code == PGM_IF_ERROR_NODATA || + pgm_error->code == PGM_IF_ERROR_NONAME || + pgm_error->code == PGM_IF_ERROR_SERVICE)) { + errno = EINVAL; + g_error_free (pgm_error); + return -1; + } - if (pgm_error->domain == PGM_IF_ERROR && ( - pgm_error->code == PGM_IF_ERROR_INVAL || - pgm_error->code == PGM_IF_ERROR_XDEV || - pgm_error->code == PGM_IF_ERROR_NODEV || - pgm_error->code == PGM_IF_ERROR_NOTUNIQ || - pgm_error->code == PGM_IF_ERROR_ADDRFAMILY || - pgm_error->code == PGM_IF_ERROR_FAMILY || - pgm_error->code == PGM_IF_ERROR_NODATA || - pgm_error->code == PGM_IF_ERROR_NONAME || - pgm_error->code == PGM_IF_ERROR_SERVICE)) { - errno = EINVAL; - g_error_free (pgm_error); - return -1; + zmq_assert (false); } - - zmq_assert (false); } // PGM transport GSI. |