Added support for Mono/Linux

This patch allows to use the FoundationDB client on Mono/Linux, tested on ver. 3.7 and CentOS 6.5

Just define MONO and it will compile for Mono/Linux
It should be a mono bug but it's there from ever I remember, if you use a
CriticalHandle, when you call the native method you get an exception
complaining about CriticalHandle not having StructLayout attribute.

Even if you mark the derived classes with the StructLayout attribute it
fails.

Cheers.


2014-08-11 14:31 GMT+02:00 Christophe Chevalier <notifications@github.com>:

> In FoundationDB.Client/Native/FdbNative.cs:
>
> > @@ -62,6 +68,434 @@ internal static unsafe class FdbNative
> >  		internal static class NativeMethods
> >  		{
> >
> > +#if MONO
> > +
> > +
> > +			private static class RealNativeCalls
>
> Is this page up to date? http://www.mono-project.com/SafeHandles seems to
> date from 2005-ish
> It seems that they support SafeHandle as arguments, and also as return
> values. Or are there some known bugs that make them unusable in practice?
>
> If we duplicate all the pinvoke code, it will be difficult to maintain if
> they add new methods in fdb 3.x, because currently I don't have any way to
> test the code in Mono.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Doxense/foundationdb-dotnet-client/pull/31/files#r16049891>
> .
>