delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/07/15/15:42:51

X-Spam-Check-By: sourceware.org
Date: Sat, 15 Jul 2006 15:42:39 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: C++ program only compiles if -mno-cygwin specified
Message-ID: <20060715194239.GB23075@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <e990br$is5$1 AT sea DOT gmane DOT org> <20060714221140 DOT GB13181 AT trixie DOT casa DOT cgf DOT cx> <e9b3ae$7qt$1 AT sea DOT gmane DOT org>
Mime-Version: 1.0
In-Reply-To: <e9b3ae$7qt$1@sea.gmane.org>
User-Agent: Mutt/1.5.11
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Sat, Jul 15, 2006 at 05:58:05PM +0200, Eric Lilja wrote:
>Christopher Faylor wrote:
>> On Fri, Jul 14, 2006 at 10:55:22PM +0200, Eric Lilja wrote:
>>> Hello, I'm using a fully updated cygwin and it seems that it puts
>>> macros named BIG_ENDIAN and LITTLE_ENDIAN into global scope if
>>> include <stdio.h> (or <cstdio>). If the program is compiled with
>>> -mno-cygwin, these macros are not present. This prevented me from
>>> compiling a third party library out-of-the-box. Here's a condensed
>>> test case that will only compile in MinGW-mode:
>>> #include <cstdio>
>>>
>>> int
>>> main()
>>> {
>>>   enum TArch1 {LITTLE_ENDIAN};
>>>   enum TArch2 {BIG_ENDIAN};
>>> }
>>>
>>> Maybe these macros need not to be in global scope for cygwin to
>>> function or maybe I can do something else and still compile the
>>> third party library under cygwin without editing the library code?
>>
>>There is no way to change this behavior other than in source code.
>>
>>Cygwin's stdio.h includes sys/types.h which defines these values.  The
>>stdio header file from glibc does not include sys/types.h.  If it did,
>>you'd have the same problem.
>
>I see.  And I presume that these values are supplied to be used by a
>third-party otherwise they would have been prefixed with double
>underscores?

Do a grep of the header files in /usr/include and you'll see where the
values are defined.

>I understand newlib has been updated over the years because if I remember 
>correctly that program used to compile under cygwin, like two years ago or 
>so. Anyway, it's easy to work around. Thanks for your help.
>[snip clever sed snippet]

This has nothing to do with newlib.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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