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



----- Original Message -----
From: "Frank Damgaard" <sslug@sslug>
To: <sslug@sslug>
Sent: Thursday, September 20, 2001 8:48 AM
Subject: Re: [CPROG] Er det Linux eller Windows ?
>...

> _WIN32 er jo netop defineret under windows32, bla. i cygwin og borland
C/C++.
> og angiver tilgang til WIN32 API.
>...
_WIN32 bliver ikke defineret af compileren men inde i windows.h
Så test programmet kan ikke compile hvis det ændres til
#include <windows.h>
#ifdef _WIN32
int main(int arg, char* args[])
{ BURDE_GIVE_EN_FEJL }
#endif
Men det kan ikke bruges til at finde ud af om man er på linux eller windows
da windows.h først skal inkluderes HVIS det er en WIN32 platform :-(

> __CYGWIN__ er kun defineret hvis man oversætter med "cygwin" enablet,
> ikke hvis man anvender minimalist cygwin uden brug af cygwin*.dll .
> Mulivis hedder variablen __CYGWIN32__, men check md dokumentationen/faq
> til cygwin, da variablen har skiftet navn igennem versionerne til cygwin.
Under faq'en skriver de at _WIN32 og __CYGWIN__ er defineret(dog at det ikke
er helt up-to-date), men ikke noget om at __CYGWIN__ ikke er definieret på
noget tidspunkt(eller at _WIN32 først bliver definieret i windows.h).
Hvis jeg kun preprocessor mit orginale testprogram (ingen #include
<windows.h>) og beder den om at skrive alle definitionerne (gcc -E -dM
test.c) så skriver den både __CYGWIN__ og __CYGWIN32__ m.f.
Men hverken _WIN32 eller noget der ligner.
Hvad mener du med minimalist cygwin, og hvordan oversætter man med "cygwin"
disabled ??

- Peter




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