Mailing-List: contact cygwin-apps-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-apps-owner AT sourceware DOT cygnus DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Delivered-To: mailing list cygwin-apps AT sources DOT redhat DOT com X-Apparently-From: Message-ID: <3AF009F8.ED32A3EB@yahoo.com> Date: Wed, 02 May 2001 09:22:00 -0400 From: Earnie Boyd Reply-To: Cygwin Apps X-Mailer: Mozilla 4.76 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: cygwin-apps AT cygwin DOT com Subject: Re: gcc/ansi question References: <20010501231814 DOT A26391 AT redhat DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Christopher Faylor wrote: > > It has been pointed out to me that I shouldn't be doing -Dunix when > using the -ansi switch with gcc because the compiler should only define > things which begin with an underscore. I can fix this easily. > > Does anyone know how MSVC handles the WIN32 definitions? Is there an > equivalent switch for Windows which disables the definition of WIN32? > My MSVC installation is currently hosed for some reason so I can't check > this myself. > According to the "Microsoft Visual C++ Run-Time Library Reference" for version 5.0: ANSI C COMPLIANCE The naming convention for all Microsoft-specific identifiers in the run-time system (such as functions, macros, constants, variables, and type definitions) is ANSI-compliant. In this book, any run-time function that follows the ANSI/ISO C standards is noted as being ANSI compatible ANSI-compliant applications should only use these ANSI compatible functions. The names of Microsoft-specific functions and global variables begin with a single underscore. These names can be overridden only locally, within the scope of your code. For example, when you include Microsoft run-time header files, you can still locally override the Microsoft-specific function names _open by declaring a local variable of the same name. However, you cannot use this name for your own local function or global variable. The names of Microsoft-specific macros and manifest constants begin with two underscores, or with a single leading underscore immediately followed by an uppercase letter. The scope of these identifiers is absolute. For example, you cannot use the Microsoft-specific identifier _UPPER for this reason. HTH, Earnie. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com