[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 ?



In article <sslug@sslug> you wrote:

> 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?

Du kukke jo lave:

#ifndef __CYGWIN__

men ellers, GnuC definerer bla. __GNUC__
og under linux er __linux__ også defineret.
Der er vistnok også noget med i386 på intel systemer..

Under windows er _WIN32 også defineret (vistnok også på andre end Cygwin)



-- 
mvh Frank Damgaard  | http://home3.inet.tele.dk/frda/



 
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] *