[Mono-osx] #define and Operating System Specific Code

Andrew Ayre andy at britishideas.com
Fri Oct 14 11:22:11 EDT 2011


So I would have to create a dummy NSAutoreleasePool so the code will
compile under Windows and Linux?

Andy

On 10/14/2011 2:52 PM, Stifu wrote:
> You can detect the OS at runtime.
> 
> http://mono.wikia.com/wiki/Detecting_the_execution_platform
> 
> 
> Andrew Ayre wrote:
>>
>> Following on from my previous question are there any suggestions on how
>> to write cross-platform code that uses threads? Currently I have:
>>
>> Thread SerialThread = new Thread(new ThreadStart(SerialHandler));
>> ...
>> SerialThread.Start();
>>
>> private void SerialHandler()
>> {
>>   NSAutoreleasePool Pool = new NSAutoreleasePool();
>>   ...
>>   Pool.Dispose();
>>   Pool = null;
>> }
>>
>> For Windows and Linux I want to omit the autorelease pool code. I'm sure
>> there must be a clever way that doesn't involve #if/#endif.
>>
>> thanks, Andy
>>
>> On 10/12/2011 3:52 PM, Andrew Ayre wrote:
>>> Hi, where can I find a list of compiler defines that Mono provides to
>>> identify the current operating system?
>>>
>>> Thanks, Andy
>>>
>>
>> -- 
>> Andy
>> PGP Key ID: 0xDC1B5864
>> _______________________________________________
>> Mono-osx mailing list
>> Mono-osx at .ximian
>> http://lists.ximian.com/mailman/listinfo/mono-osx
>>
> 
> 
> --
> View this message in context: http://mono.1490590.n4.nabble.com/define-and-Operating-System-Specific-Code-tp3898256p3904918.html
> Sent from the Mono - OSX mailing list archive at Nabble.com.
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
> 
> 
> 

-- 
Andy
PGP Key ID: 0xDC1B5864


More information about the Mono-osx mailing list