delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/10/28/05:30:20

From: kh AT wg DOT icl DOT co DOT uk (Kevin Hughes)
Subject: cpp - conditional expressions inder win95 differ to under Unix
28 Oct 1997 05:30:20 -0800 :
Message-ID: <9710281241.AA04162.cygnus.gnu-win32@ss38.wg.icl.co.uk>
To: gnu-win32 AT cygnus DOT com

I have been using the gnu tools on UNIX for some considerable time and find 
them very good. Recently I have been trying to move to NT :-( and have been 
using the gnu port to win32. I have had some problems that the list has 
managed to sort out or point me in the right direction. I have just come across
one I just cannot understand

I have code which has many tests for the OS on which it will run, done via 
CPP. Hence I have code like

#if PLATFORM_OS == solaris


#endif

#if PLATFORM_OS == win32


#endif

With the value of PLATFORM_OS being passed in via the build system I use.

This works great on SOLARIS/SUNOS/UNIXWARE (2.7.2/egcs etc) but I cannot get 
it to work on the Win32 environment. It apepars to go down all paths - as if 
PLATFORM_OS is not defined OR the individual checks are ALWAYS satisfied.

I have added a guranteed fail line

PLATFORM_OS

before any tests and get a compiler message indicating that win32 does not exist
so the value is right.

Anyone any ideas?

Thanks

	Kevin
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019