[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] Er det Linux eller Windows ?



"Peter Aagaard Kristensen" <sslug@sslug> skrev i en meddelelse
news:sslug@sslug
> Hej cprog
> Jeg er i gang med at skrive et program som skal køre på både MS Windows og
> Linux. Jeg skal programmere den serielle port, og da det gøres forskelligt
> på Windows og Linux bliver jeg nød til at skrive noget platform specifik
> kode.
> På Windows bruger jeg CygWin til at compile mit program med, og for at
> genkende at jeg er i Windows har jeg et:
> #ifdef __CYGWIN__
> direktiv som omslutter den Windows specifikke kode.
> Definierer gcc en tilsvarende makro når man er på linux platformen?
>
> MVH
>   Peter Kristensen
>
Hej!

Du kan selv definere et directive du vil kompilere til Linux. Giv gcc fx
en -D__MY_DIRECTIVE_LINUX__

og i din kode:

#ifdef __MY_DIRECTIVE_LINUX__
/* linux kode*/
#endif

-Jan





 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *