Skip to content

Commit 8ef6b6c

Browse files
committed
Add #if to accessibility modifiers for new Unity testing.
1 parent 5fe8db7 commit 8ef6b6c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+583
-152
lines changed

src/MsgPack.Unity.Full/Serialization/AotHelper.cs

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#region -- License Terms --
1+
#region -- License Terms --
22
//
33
// MessagePack for CLI
44
//
5-
// Copyright (C) 2015-2016 FUJIWARA, Yusuke
5+
// Copyright (C) 2015-2018 FUJIWARA, Yusuke
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.
@@ -18,6 +18,10 @@
1818
//
1919
#endregion -- License Terms --
2020

21+
#if UNITY_5 || UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WII || UNITY_IPHONE || UNITY_ANDROID || UNITY_PS3 || UNITY_XBOX360 || UNITY_FLASH || UNITY_BKACKBERRY || UNITY_WINRT
22+
#define UNITY
23+
#endif
24+
2125
using System;
2226
using System.Collections.Generic;
2327
using System.Globalization;
@@ -28,7 +32,12 @@
2832

2933
namespace MsgPack.Serialization
3034
{
31-
internal static partial class AotHelper
35+
#if UNITY && DEBUG
36+
public
37+
#else
38+
internal
39+
#endif
40+
static partial class AotHelper
3241
{
3342
public static void HandleAotError( Type mayBeGenericArgument, Exception mayBeAotError )
3443
{
@@ -95,12 +104,12 @@ public static object CreateSystemCollectionsGenericDictionary( ConstructorInfo c
95104
return constructor.InvokePreservingExceptionType( initialCapacity, GetEqualityComparer( keyType ) );
96105
}
97106

98-
internal static IEqualityComparer<T> GetEqualityComparer<T>()
107+
public static IEqualityComparer<T> GetEqualityComparer<T>()
99108
{
100109
return ( IEqualityComparer<T> ) GetEqualityComparer( typeof( T ) );
101110
}
102111

103-
internal static object GetEqualityComparer( Type type )
112+
public static object GetEqualityComparer( Type type )
104113
{
105114
lock ( EqualityComparerTable )
106115
{
@@ -118,7 +127,7 @@ internal static object GetEqualityComparer( Type type )
118127
}
119128
}
120129

121-
internal static void PrepareEqualityComparer<T>()
130+
public static void PrepareEqualityComparer<T>()
122131
{
123132
lock ( EqualityComparerTable )
124133
{

src/MsgPack/BigEndianBinary.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// MessagePack for CLI
44
//
5-
// Copyright (C) 2010-2016 FUJIWARA, Yusuke
5+
// Copyright (C) 2010-2018 FUJIWARA, Yusuke
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.
@@ -32,9 +32,14 @@
3232
namespace MsgPack
3333
{
3434
/// <summary>
35-
/// Define bit operations which enforce big endian.
35+
/// Defines bit operations which enforce big endian.
3636
/// </summary>
37-
internal static class BigEndianBinary
37+
#if UNITY && DEBUG
38+
public
39+
#else
40+
internal
41+
#endif
42+
static class BigEndianBinary
3843
{
3944
public static sbyte ToSByte( byte[] buffer, int offset )
4045
{

src/MsgPack/Binary.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#region -- License Terms --
1+
#region -- License Terms --
22
//
33
// MessagePack for CLI
44
//
5-
// Copyright (C) 2010-2014 FUJIWARA, Yusuke
5+
// Copyright (C) 2010-2018 FUJIWARA, Yusuke
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.
@@ -18,6 +18,10 @@
1818
//
1919
#endregion -- License Terms --
2020

21+
#if UNITY_5 || UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WII || UNITY_IPHONE || UNITY_ANDROID || UNITY_PS3 || UNITY_XBOX360 || UNITY_FLASH || UNITY_BKACKBERRY || UNITY_WINRT
22+
#define UNITY
23+
#endif
24+
2125
using System;
2226
using System.Text;
2327

@@ -26,7 +30,12 @@ namespace MsgPack
2630
/// <summary>
2731
/// Defines binary related utilities.
2832
/// </summary>
29-
internal static class Binary
33+
#if UNITY && DEBUG
34+
public
35+
#else
36+
internal
37+
#endif
38+
static class Binary
3039
{
3140
/// <summary>
3241
/// Singleton empty <see cref="Byte"/>[].

src/MsgPack/ByteBufferAllocator.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#region -- License Terms --
1+
#region -- License Terms --
22
//
33
// MessagePack for CLI
44
//
5-
// Copyright (C) 2017 FUJIWARA, Yusuke
5+
// Copyright (C) 2017-2018 FUJIWARA, Yusuke
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.
@@ -18,14 +18,23 @@
1818
//
1919
#endregion -- License Terms --
2020

21+
#if UNITY_5 || UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WII || UNITY_IPHONE || UNITY_ANDROID || UNITY_PS3 || UNITY_XBOX360 || UNITY_FLASH || UNITY_BKACKBERRY || UNITY_WINRT
22+
#define UNITY
23+
#endif
24+
2125
using System;
2226

2327
namespace MsgPack
2428
{
2529
/// <summary>
2630
/// Defines common interface for byte buffer allocators.
2731
/// </summary>
28-
internal abstract class ByteBufferAllocator
32+
#if UNITY && DEBUG
33+
public
34+
#else
35+
internal
36+
#endif
37+
abstract class ByteBufferAllocator
2938
{
3039
// This type should be public when the design is fixed for Span<byte>
3140

src/MsgPack/MessagePackByteArrayPacker.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#region -- License Terms --
1+
#region -- License Terms --
22
//
33
// MessagePack for CLI
44
//
5-
// Copyright (C) 2017 FUJIWARA, Yusuke
5+
// Copyright (C) 2017-2018 FUJIWARA, Yusuke
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.
@@ -18,6 +18,10 @@
1818
//
1919
#endregion -- License Terms --
2020

21+
#if UNITY_5 || UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WII || UNITY_IPHONE || UNITY_ANDROID || UNITY_PS3 || UNITY_XBOX360 || UNITY_FLASH || UNITY_BKACKBERRY || UNITY_WINRT
22+
#define UNITY
23+
#endif
24+
2125
using System;
2226
using System.Collections.Generic;
2327
using System.Globalization;
@@ -32,7 +36,12 @@ namespace MsgPack
3236
/// <summary>
3337
/// Implementation for byte array based MessagePack packer.
3438
/// </summary>
35-
internal sealed partial class MessagePackByteArrayPacker : ByteArrayPacker
39+
#if UNITY && DEBUG
40+
public
41+
#else
42+
internal
43+
#endif
44+
sealed partial class MessagePackByteArrayPacker : ByteArrayPacker
3645
{
3746
private const int MaximumUtf8Length = 4;
3847

src/MsgPack/MessagePackByteArrayUnpacker.cs

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#region -- License Terms --
1+
#region -- License Terms --
22
//
33
// MessagePack for CLI
44
//
5-
// Copyright (C) 2017 FUJIWARA, Yusuke
5+
// Copyright (C) 2017-2018 FUJIWARA, Yusuke
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.
@@ -18,6 +18,10 @@
1818
//
1919
#endregion -- License Terms --
2020

21+
#if UNITY_5 || UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WII || UNITY_IPHONE || UNITY_ANDROID || UNITY_PS3 || UNITY_XBOX360 || UNITY_FLASH || UNITY_BKACKBERRY || UNITY_WINRT
22+
#define UNITY
23+
#endif
24+
2125
using System;
2226
using System.Globalization;
2327
using System.Text;
@@ -31,7 +35,12 @@ namespace MsgPack
3135
/// <summary>
3236
/// Implements common features for byte array based MessagePack unpacker.
3337
/// </summary>
34-
internal abstract partial class MessagePackByteArrayUnpacker : ByteArrayUnpacker, IRootUnpacker
38+
#if UNITY && DEBUG
39+
public
40+
#else
41+
internal
42+
#endif
43+
abstract partial class MessagePackByteArrayUnpacker : ByteArrayUnpacker, IRootUnpacker
3544
{
3645
private byte[] _source;
3746
private int _offset;
@@ -99,17 +108,27 @@ MessagePackObject IRootUnpacker.LastReadData
99108

100109
#if DEBUG
101110

102-
internal byte[] DebugSource
111+
#if UNITY && DEBUG
112+
public
113+
#else
114+
internal
115+
#endif
116+
byte[] DebugSource
103117
{
104118
get { return this._source; }
105119
}
106120

107-
internal long DebugOffset
121+
#if UNITY && DEBUG
122+
public
123+
#else
124+
internal
125+
#endif
126+
long DebugOffset
108127
{
109128
get { return this._offset; }
110129
}
111130

112-
internal sealed override long? UnderlyingStreamPosition
131+
internal override long? UnderlyingStreamPosition
113132
{
114133
get { return this._offset; }
115134
}

src/MsgPack/MessagePackCode.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#region -- License Terms --
1+
#region -- License Terms --
22
//
33
// MessagePack for CLI
44
//
5-
// Copyright (C) 2010-2014 FUJIWARA, Yusuke
5+
// Copyright (C) 2010-2018 FUJIWARA, Yusuke
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.
@@ -18,11 +18,20 @@
1818
//
1919
#endregion -- License Terms --
2020

21+
#if UNITY_5 || UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WII || UNITY_IPHONE || UNITY_ANDROID || UNITY_PS3 || UNITY_XBOX360 || UNITY_FLASH || UNITY_BKACKBERRY || UNITY_WINRT
22+
#define UNITY
23+
#endif
24+
2125
using System;
2226

2327
namespace MsgPack
2428
{
25-
internal static class MessagePackCode
29+
#if UNITY && DEBUG
30+
public
31+
#else
32+
internal
33+
#endif
34+
static class MessagePackCode
2635
{
2736
public const int NilValue = 0xc0;
2837
public const int TrueValue = 0xc3;

src/MsgPack/MessagePackExtendedTypeObject.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#region -- License Terms --
1+
#region -- License Terms --
22
//
33
// MessagePack for CLI
44
//
5-
// Copyright (C) 2010-2014 FUJIWARA, Yusuke
5+
// Copyright (C) 2010-2018 FUJIWARA, Yusuke
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.
@@ -18,6 +18,10 @@
1818
//
1919
#endregion -- License Terms --
2020

21+
#if UNITY_5 || UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WII || UNITY_IPHONE || UNITY_ANDROID || UNITY_PS3 || UNITY_XBOX360 || UNITY_FLASH || UNITY_BKACKBERRY || UNITY_WINRT
22+
#define UNITY
23+
#endif
24+
2125
using System;
2226
using System.Text;
2327

@@ -55,7 +59,12 @@ public byte TypeCode
5559
/// <value>
5660
/// A binary value portion of this object. This value will not be null.
5761
/// </value>
58-
internal byte[] Body
62+
#if UNITY && DEBUG
63+
public
64+
#else
65+
internal
66+
#endif
67+
byte[] Body
5968
{
6069
get { return this._body ?? Binary.Empty; }
6170
}
@@ -155,7 +164,12 @@ public override string ToString()
155164
return buffer.ToString();
156165
}
157166

158-
internal void ToString( StringBuilder buffer, bool isJson )
167+
#if UNITY && DEBUG
168+
public
169+
#else
170+
internal
171+
#endif
172+
void ToString( StringBuilder buffer, bool isJson )
159173
{
160174
if ( isJson )
161175
{

src/MsgPack/MessagePackObject.Utilities.cs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// MessagePack for CLI
44
//
5-
// Copyright (C) 2010-2017 FUJIWARA, Yusuke
5+
// Copyright (C) 2010-2018 FUJIWARA, Yusuke
66
//
77
// Licensed under the Apache License, Version 2.0 (the "License");
88
// you may not use this file except in compliance with the License.
@@ -196,7 +196,12 @@ public MessagePackObject( MessagePackObjectDictionary value, bool isImmutable )
196196
/// Initializes a new instance wraps <see cref="MessagePackString"/>.
197197
/// </summary>
198198
/// <param name="messagePackString"><see cref="MessagePackString"/> which represents byte array or UTF-8 encoded string.</param>
199-
internal MessagePackObject( MessagePackString messagePackString )
199+
#if UNITY && DEBUG
200+
public
201+
#else
202+
internal
203+
#endif
204+
MessagePackObject( MessagePackString messagePackString )
200205
{
201206
// trick: Avoid long boilerplate initialization. See "CLR via C#".
202207
this = new MessagePackObject();
@@ -1875,10 +1880,15 @@ public static implicit operator MessagePackObject( MessagePackObject[] value )
18751880
return new MessagePackObject( value, false );
18761881
}
18771882

1878-
#endregion -- Conversion Operator Overloads --
1883+
#endregion -- Conversion Operator Overloads --
18791884

18801885
#if DEBUG
1881-
internal string DebugDump()
1886+
#if UNITY && DEBUG
1887+
public
1888+
#else
1889+
internal
1890+
#endif
1891+
string DebugDump()
18821892
{
18831893
var typeCode = this._handleOrTypeCode as ValueTypeCode;
18841894
if ( typeCode != null )
@@ -1897,7 +1907,7 @@ internal string DebugDump()
18971907
#endif // DEBUG
18981908

18991909
#if !SILVERLIGHT && !NETSTANDARD1_1 && !NETSTANDARD1_3
1900-
[Serializable]
1910+
[ Serializable ]
19011911
#endif // !SILVERLIGHT && !NETSTANDARD1_1 && !NETSTANDARD1_3
19021912
private enum MessagePackValueTypeCode
19031913
{

0 commit comments

Comments
 (0)