The __WINE__ macro does not identify the Wine platform

Mike Kaplinskiy mike.kaplinskiy at gmail.com
Thu Jun 17 16:13:32 CDT 2010


On Thu, Jun 17, 2010 at 4:56 PM, Alan W. Irwin
<irwin at beluga.phys.uvic.ca> wrote:
> According to some old discussion
> (http://www.mail-archive.com/wine-devel@winehq.com/msg15669.html) on
> wine-devel it appears that __WINE__ was going to be the macro used to
> identify the Wine platform,
>
> However, that doesn't appear to work for Windows native MinGW on wine.
>
> To show this, I attach results from running
>
> wine gcc -E -dM foo.c >| /tmp/wine_gcc_dM.out
>
> where foo.c is an empty file, and gcc is the MinGW 4.5.0-1 version. The
> equivalent command under Linux gcc shows several macros, (e.g., __linux__)
> are defined to identify that platform, but I cannot find anything in the
> attached file that similarly identifies the Wine platform.  Furthermore, I
> have compiled and run a simple test code under Wine that shows that __WINE__
> is not available (see previous post on wine-users for details).
>
> An excellent general motivation for such an identifying macro for wine is
> given in the above older wine-devel discussion, and I understand the CMake
> developers have an immediate use for such a macro within the CMake code
> itself.
>
> Is the lack of a macro to identify the wine platform a bug I should report
> or am I missing something?
>
> Alan
> __________________________
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
>
> Programming affiliations with the FreeEOS equation-of-state implementation
> for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
> package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
> Linux Links project (loll.sf.net); and the Linux Brochure Project
> (lbproject.sf.net).
> __________________________
>
> Linux-powered Science
> __________________________
>
>
>

You're compiling _under_ wine, and since wine attempts to be windows,
gcc will think you're on windows. If you want to compile a winelib
program/dll (i.e. a dll built specifically for wine and not windows)
you use winegcc which defines __WINE__. winegcc -E -dM foo.c should
contain #define __WINE__ 1.

Mike.



More information about the wine-devel mailing list