X-Spam-Check-By: sourceware.org Date: Fri, 14 Jul 2006 18:11:40 -0400 From: Christopher Faylor To: cygwin AT cygwin DOT com Subject: Re: C++ program only compiles if -mno-cygwin specified Message-ID: <20060714221140.GB13181@trixie.casa.cgf.cx> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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 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 >(or ). 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 > >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. sed -pi.bak -e 's/LITTLE_ENDIAN/MY_LITTLE_ENDIAN/g' *.[ch] 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/