Subject: Re: can't figure something out in gl.h
From: [email-masked] (Earnie Boyd)

23 Sep 1997 06:31:07 -0700
Message-ID: <[email-masked]>
Content-Type: text/plain
To: [email-masked], [email-masked]

>Date: Mon, 22 Sep 1997 17:04:32 -0400 (EDT)
>From: "John R. Dennis" <[email-masked]>
>To: [email-masked]
>Subject: Re: can't figure something out in gl.h
>
>>>>>> "Earnie" == Earnie Boyd <[email-masked]> 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----
[email-masked]
------ooo0O--O0ooo-------

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".