[Mono-list] Diagnostic Messages

Miguel de Icaza miguel@ximian.com
27 May 2002 22:57:16 -0400


> I do agree that on Win32 OutputDebugString should be used.  However,
> before I implement that I need to figure out how to properly make the C#
> code conditional, for either Win32 or Unix systems.  This would likely
> require changing the `System.build' file, and probably introduces
> logistical issues.  For example, if we did this, we would have a
> `System.dll' that was specific to Windows or specific to Linux. 
> `corlib.dll' need to do the same thing, so this shouldn't be a major
> issue.

You can do this dynamically, just probe the OS (I forget how to do this,
but it is done in a few places in the class libraries) and execute the
code that you need to do:

if (is_windows){
    OutputDebugString (...);
} else {
}

OutputDebugString is probably a Dllimported method, so unless you
actually invoke it, the code will just work fine.

Miguel.