From: <ha...@us...> - 2011-02-20 08:50:41
|
Revision: 8124 http://octave.svn.sourceforge.net/octave/?rev=8124&view=rev Author: hauberg Date: 2011-02-20 08:50:35 +0000 (Sun, 20 Feb 2011) Log Message: ----------- Make the code compile with Octave 3.4 Modified Paths: -------------- trunk/octave-forge/main/sockets/src/sockets.cc Modified: trunk/octave-forge/main/sockets/src/sockets.cc =================================================================== --- trunk/octave-forge/main/sockets/src/sockets.cc 2011-02-20 08:28:44 UTC (rev 8123) +++ trunk/octave-forge/main/sockets/src/sockets.cc 2011-02-20 08:50:35 UTC (rev 8124) @@ -413,9 +413,36 @@ const octave_base_value& struct_serverInfo = args(1).get_rep(); octave_struct& addrInfo = ((octave_struct&)struct_serverInfo); +#if MINORVERSION <= 2 string addr = addrInfo.map_value().stringfield("addr"); int port = addrInfo.map_value().intfield("port"); +#else + const Cell addr_cell = addrInfo.map_value().getfield ("addr"); + string addr; + if (addr_cell.numel () == 1 && addr_cell (0).is_string ()) + { + addr = addr_cell (0).string_value (); + } + else + { + error ("connect: invalid input: no 'addr' field"); + return octave_value (-1); + } + const Cell port_cell = addrInfo.map_value().getfield ("port"); + int port; + if (port_cell.numel () == 1 && port_cell (0).is_numeric_type ()) + { + port = port_cell (0).int_value (); + } + else + { + error ("connect: invalid input: no 'port' field"); + return octave_value (-1); + } +#endif + + // Determine the socket on which to operate octave_socket* s = NULL; if ( args(0).type_id() == octave_socket::static_type_id() ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |