Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2984)

Unified Diff: src/dsr/model/dsr-fs-header.cc

Issue 8932044: Minimum changes needed to support ns-3 on Visual Studio 2012
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/dsdv/model/dsdv-rtable.cc ('k') | src/internet/model/icmpv6-l4-protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/dsr/model/dsr-fs-header.cc
===================================================================
--- a/src/dsr/model/dsr-fs-header.cc
+++ b/src/dsr/model/dsr-fs-header.cc
@@ -156,7 +156,11 @@
m_payloadLen = i.ReadU16 ();
uint32_t dataLength = GetPayloadLength ();
+#ifndef WIN32
uint8_t data[dataLength];
+#else
+ uint8_t * data = new uint8_t[dataLength];
+#endif
i.Read (data, dataLength);
if (dataLength > m_data.GetSize ())
@@ -170,7 +174,9 @@
i = m_data.Begin ();
i.Write (data, dataLength);
-
+#ifdef WIN32
+ delete [] data;
+#endif
return GetSerializedSize ();
}
@@ -211,11 +217,18 @@
uint32_t DsrOptionField::Deserialize (Buffer::Iterator start, uint32_t length)
{
+#ifndef WIN32
uint8_t buf[length];
+#else
+ uint8_t * buf = new uint8_t[length];
+#endif
start.Read (buf, length);
m_optionData = Buffer ();
m_optionData.AddAtEnd (length);
m_optionData.Begin ().Write (buf, length);
+#ifdef WIN32
+ delete [] buf;
+#endif
return length;
}
« no previous file with comments | « src/dsdv/model/dsdv-rtable.cc ('k') | src/internet/model/icmpv6-l4-protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b