Mail Archives: cygwin/1997/09/23/06:31:07
>Date: Mon, 22 Sep 1997 17:04:32 -0400 (EDT)
>From: "John R. Dennis" <jdennis AT sharpeye DOT com>
>To: gnu-win32 AT cygnus DOT com
>Subject: Re: can't figure something out in gl.h
>
>>>>>> "Earnie" == Earnie Boyd <earnie_boyd AT hotmail DOT com> writes:
>
> Earnie> I believe the problem is the it should be "_WIN32" and not
> Earnie> "WIN32".
>
>Confession time here. I never did understand the distinction between
>the _WIN32 and WIN32 symbols. The MSVC Doc says it defines _WIN32 not
>WIN32. When I first started programming in Win32 I used the _WIN32
>symbol. Then I started to notice all the example code I saw used the
>WIN32 symbol, which seemed to me to be cleaner (I had always though
>leading underscore symbols were reserved for use by the system). Lo
>and behold WIN32 seemed to be defined and everything worked. I'm
>guessing here, not having tracked it down, but I'm assuming the
>pre-processor predefines _WIN32 and some other header file then
>defines WIN32 as a consequence. It seems like the preferred symbol is
>WIN32 based on the code coming from Microsoft. Anyway care to shed
>some light on this?
>
>--
From what I've read (don't remember exactly where) it is a standards
thing. Whose standards are to be followed? GNU follows the POSIX
standards and not explicitly those set by MS; however, they have tried
to provide for that which already exists in order to make the product as
backward compatible as possible.
Although it is possible for the pre-processor to have hard coded macros
(that what the WIN32 or _WIN32 is actually called) the GNU route is to
use setup files to control what macros are defined and the values of
those macros.
As Sergey pointed out you can define a macro by supplying a -Dmacro
switch if you want to explicitly define WIN32 or you could implicitly
define the macro in a config.h or some such header that would test for
the existance of _WIN32 before setting WIN32. It all depends on if the
product produced will be ported to different platforms.
Hope this helps,
- \\||//
---o0O0--Earnie--0O0o----
-earnie_boyd AT hotmail DOT com-
------ooo0O--O0ooo-------
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
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 -