aBothe / Mono-D

D Add-In for MonoDevelop
http://wiki.dlang.org/Mono-D
Other
113 stars 26 forks source link

Wrong extension used for shared libs on OSX #616

Closed nicolasjinchereau closed 9 years ago

nicolasjinchereau commented 9 years ago

shared libs get ".so" extension instead of ".dylib"

nicolasjinchereau commented 9 years ago

Mac OSX Yosemite

aBothe commented 9 years ago

Hmm, I thought I put in .dylib-extensions already. Perhaps the OS-check is failing.

nicolasjinchereau commented 9 years ago

Console.WriteLine(Environment.OSVersion); I get "Unix".... That can't be right

nicolasjinchereau commented 9 years ago

https://bugzilla.xamarin.com/show_bug.cgi?id=13345

nicolasjinchereau commented 9 years ago

This seems to work:

*Add reference to 'Mono.Posix'

using System;
using Mono.Unix.Native;

namespace PlatformTest
{
    class MainClass
    {
        static bool IsMac()
        {
            if(Environment.OSVersion.Platform != PlatformID.Unix)
                return false;

            Utsname results;
            Syscall.uname(out results);
            return results.sysname == "Darwin";
        }

        public static void Main(string[] args) {
            Console.WriteLine(IsMac());
        }
    }
}
nicolasjinchereau commented 9 years ago

https://github.com/aBothe/Mono-D/pull/617

I figured I should let you add the reference to Mono.Posix.dll yourself. Please see comments on pull request.

aBothe commented 9 years ago

This issue should be solved now.

nicolasjinchereau commented 9 years ago

:+1: