diff options
author | csharptest <roger@csharptest.net> | 2012-10-14 18:47:48 -0500 |
---|---|---|
committer | rogerk <devnull@localhost> | 2012-10-14 18:47:48 -0500 |
commit | 6716432ca60b1ad53b20165d9bc29f853fcf1deb (patch) | |
tree | f46d00d19039aa442ca361f46cfc33bf80e09d8f /src/ProtocolBuffers/FrameworkPortability.cs | |
parent | 0f56b842987dce4699be8a4e9e3cb353497a305a (diff) | |
download | protobuf-6716432ca60b1ad53b20165d9bc29f853fcf1deb.tar.gz protobuf-6716432ca60b1ad53b20165d9bc29f853fcf1deb.tar.bz2 protobuf-6716432ca60b1ad53b20165d9bc29f853fcf1deb.zip |
Last (hopefully) changes to pre-processing directives
Diffstat (limited to 'src/ProtocolBuffers/FrameworkPortability.cs')
-rw-r--r-- | src/ProtocolBuffers/FrameworkPortability.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ProtocolBuffers/FrameworkPortability.cs b/src/ProtocolBuffers/FrameworkPortability.cs index 78b7db31..fee8fbac 100644 --- a/src/ProtocolBuffers/FrameworkPortability.cs +++ b/src/ProtocolBuffers/FrameworkPortability.cs @@ -63,6 +63,28 @@ namespace Google.ProtocolBuffers get { return CultureInfo.InvariantCulture; }
}
+ internal static double Int64ToDouble(long value)
+ {
+#if CLIENTPROFILE
+ return BitConverter.Int64BitsToDouble(value);
+#else
+ double[] arresult = new double[1];
+ Buffer.BlockCopy(new[] { value }, 0, arresult, 0, 8);
+ return arresult[0];
+#endif
+ }
+
+ internal static long DoubleToInt64(double value)
+ {
+#if CLIENTPROFILE
+ return BitConverter.DoubleToInt64Bits(value);
+#else
+ long[] arresult = new long[1];
+ Buffer.BlockCopy(new[] { value }, 0, arresult, 0, 8);
+ return arresult[0];
+#endif
+ }
+
internal static bool TryParseInt32(string text, out int number)
{
return TryParseInt32(text, NumberStyles.Any, InvariantCulture, out number);
|