Skip to content

Commit 100f4b5

Browse files
committed
Fix MessagePackString prevents App Certification. Issue #65
memcmp prevents Windows Store App Certification even if it improves equality comparison about 1000x faster.
1 parent 3ef9106 commit 100f4b5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Sync.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<Exclude Path="Serialization\SerializerGenerator.cs" />
8787
<Exclude Path="Serialization\Reflection\TracingILGenerator.*" />
8888
<Exclude Path="Serialization\Tracer.cs" />
89+
<Exclude Path="UnsafeNativeMethods.cs" />
8990
<Exclude Path="Validation.cs" />
9091
</Project>
9192
<Project Name="MsgPack.Silverlight.5" Base="MsgPack">
@@ -122,7 +123,6 @@
122123
<Preserve Path="Properties\AssemblyInfo.cs" />
123124
<Preserve Path="Serialization\Metadata\_DictionaryEntry.cs" />
124125
<Exclude Path="Serialization\Reflection\ReflectionHelpers.cs" />
125-
<Exclude Path="UnsafeNativeMethods.cs" />
126126
<Exclude Path="WinRTCompatibility.cs" />
127127
</Project>
128128
</ProjectSync>

src/MsgPack/MessagePackString.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ private static bool EqualsEncoded( MessagePackString left, MessagePackString rig
263263
return false;
264264
}
265265

266-
#if !UNITY && !WINDOWS_PHONE
266+
#if !UNITY && !WINDOWS_PHONE && !NETFX_CORE
267267
if ( _isFastEqualsDisabled == 0 )
268268
{
269269
try
@@ -279,7 +279,7 @@ private static bool EqualsEncoded( MessagePackString left, MessagePackString rig
279279
Interlocked.Exchange( ref _isFastEqualsDisabled, 1 );
280280
}
281281
}
282-
#endif // if !UNITY && !WINDOWS_PHONE
282+
#endif // if !UNITY && !WINDOWS_PHONE && !NETFX_CORE
283283

284284
return SlowEquals( left._encoded, right._encoded );
285285
}
@@ -297,7 +297,7 @@ private static bool SlowEquals( byte[] x, byte[] y )
297297
return true;
298298
}
299299

300-
#if !UNITY && !WINDOWS_PHONE
300+
#if !UNITY && !WINDOWS_PHONE && !NETFX_CORE
301301
#if SILVERLIGHT
302302
private static int _isFastEqualsDisabled =
303303
System.Windows.Application.Current.HasElevatedPermissions ? 0 : 1;
@@ -333,7 +333,7 @@ private static bool UnsafeFastEquals( byte[] x, byte[] y )
333333

334334
return result == 0;
335335
}
336-
#endif // if !UNITY && !WINDOWS_PHONE
336+
#endif // if !UNITY && !WINDOWS_PHONE && !NETFX_CORE
337337

338338
#if !SILVERLIGHT && !NETFX_CORE
339339
[Serializable]

test/MsgPack.UnitTest/MessagePackStringTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void TestToString_EmptyString()
136136
Assert.AreEqual( String.Empty, target.ToString() );
137137
}
138138

139-
#if !UNITY && !WINDOWS_PHONE
139+
#if !UNITY && !WINDOWS_PHONE && !NETFX_CORE
140140
[Test]
141141
public void TestEqualsFullTrust()
142142
{
@@ -154,7 +154,7 @@ private void ShowResult( Tuple<double, double, double, double> result )
154154
Console.WriteLine( "Large(100,000 chars) : {0:#,0.0} usec", result.Item4 );
155155
}
156156

157-
#endif // !UNITY && !WINDOWS_PHONE
157+
#endif // !UNITY && !WINDOWS_PHONE && !NETFX_CORE
158158

159159
#if !NETFX_CORE && !WINDOWS_PHONE && !XAMIOS && !XAMDROID && !UNITY
160160
private static StrongName GetStrongName( Type type )

0 commit comments

Comments
 (0)