[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MINGW build
From: |
Paul Kienzle |
Subject: |
Re: MINGW build |
Date: |
Thu, 10 Oct 2002 09:39:42 -0400 |
On Thu, Oct 10, 2002 at 01:19:26AM -0500, John W. Eaton wrote:
> On 23-Sep-2002, Mumit Khan <address@hidden> wrote:
>
> | I do have a comment on using the pre-processor macro/s to determine
> | the system or system type. If you want a Windows 32 bit system, then
> | it's __WIN32__ and/or __WIN32 (the non-underscored counterparts are
> | an abomination); if you want to exclude Cygwin, then it's __WIN32__ &&
> | !__CYGWIN__. Mingw is plain Windows32, and thus covered by __WIN32__,
> | and there is typically never a good reason to use __MINGW32__ explicitly,
> | unless you're taking advantage of something specific in Mingw helper
> | libraries.
The following prints __WIN32__ on mingw and __CYGWIN__/__CYGWIN32__ on
cygwin.
#include <stdio.h>
int main(int argc, char *argv[])
{
#if defined(__WIN32__)
printf("__WIN32__\n");
#endif
#if defined(__CYGWIN__)
printf("__CYGWIN__\n");
#endif
#if defined(__CYGWIN32__)
printf("__CYGWIN32__\n");
#endif
#if defined(__WIN__)
printf("__WIN__\n");
#endif
}
So should we be using defined(__WIN32__) to mean that we should use the
win32api directly rather than going through the Cygwin posix layer?
Currently we are using defined(__WIN32__) && !defined(_POSIX_VERSION).
I have no particular desire to do so, but it may be possible for someone
to use an alternative unix emulation layer (e.g., Uwin). Should we be defining
USE_WINDOWS_PATHNAMES instead of defined(__CYGWIN__)||defined(__WIN32__)?
So far the Windows build is not much of an issue. The following displays
16 lines in my source tree:
grep "__.*WIN" {liboctave,src}/*.{c,cc,h} | less
Paul Kienzle
address@hidden