How to know if I'm running UNITY_EDITOR on Windows or Mac?

I have a script that I like to run on Windows/Mac in Unity Editor,
which is truly platform dependent. I found that UNITY_EDITOR will be effective for both platforms, but there is no obvious way to tell if I’m running the editor on Windows or Mac.

Any ideas?
Thanks!

I see these options here: http://unity3d.com/support/documentation/ScriptReference/RuntimePlatform.html

Application.platform should return the correct result while in the editor.

bool isWinEditor = Application.platform == RuntimePlatform.WindowsEditor;
bool isOSXEditor = Application.platform == RuntimePlatform.OSXEditor;

UNITY_EDITOR_WIN and UNITY_EDITOR_OSX are available in the latest versions of Unity. Not sure which version this got introduced, though.

I needed to do this, but couldn’t find anything in Unity itself, so ended up using a .NET Framework API. Below is the code I use, which is based on the code in the answer to the “How to detect the execution platform?” question in the Mono technical FAQ. It returns false on Windows and true on Mac (and other Unix-like OSes):

    public static bool IsUnix()
    {
        var platform = (int)System.Environment.OSVersion.Platform;
        return (platform == 4) || (platform == 6) || (platform == 128);
    }

More details at FAQ: Technical | Mono and PlatformID Enum (System) | Microsoft Learn.