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
Hi Christophe.

Mono indeed supports SafeHandles, what is not supported are CriticalHandles.

I have tested to change FdbSafeHandle to inherit from SafeHandle and
everything works, also SafeLibraryHandle can inherit from FdbSafeHandle.

Do you prefer to use SafeHandles instead of Criticalhandles or the function
wrapping?

Cheers.




2014-08-11 15:08 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
>
> Well that's a bummer, because that means that the Mono branch is
> vulnerable to resource leaks if anything happen (like a
> ThreadAbortException) while the IntPtr is still not safely stored in the
> SafeHandle...
>
> I hope that this will not cause any weird issues when running on Mono.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Doxense/foundationdb-dotnet-client/pull/31/files#r16051314>
> .
>