dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #14372
Re: [HG DOLFIN] A try to fix a compilation error on windows
On Fri, July 10, 2009 11:38, Johan Hake wrote:
> On Thursday 09 July 2009 11:05:06 DOLFIN wrote:
>> One or more new changesets pushed to the primary dolfin repository.
>> A short summary of the last three changesets is included below.
>>
>> changeset: 6462:c8f1abce86c21c30c0fefc2ec711634e2784370c
>> tag: tip
>> user: "Johan Hake <hake@xxxxxxxxx>"
>> date: Thu Jul 09 11:05:01 2009 +0200
>> files: bench/mesh/main.cpp
>> description:
>> A try to fix a compilation error on windows
>>
>>
>> changeset: 6461:0f6c07274a485ab4e96a43079023f4e77d490bc9
>> user: "Garth N. Wells <gnw20@xxxxxxxxx>"
>> date: Thu Jul 09 09:39:23 2009 +0100
>> files: dolfin/la/PETScKrylovSolver.cpp
>> description:
>> Fix leak in PETScKrylovSolver picked up by Johan Hake.
>
> This one did not work.
>
> Is there a way to introduce some platform specific code in the c++ files?
> I
> tried
>
> #ifdef WIN32
> #include <windows.h>
> #define sleep(n) Sleep(1000 * n)
> #endif /* WIN32 */
>
> But WIN32 is not defined. Should this explicitly be added by the build
> system,
> or is there some implicit __WIN32__ define that is set by the compiler?
If I remember correctly you should use
#ifdef _WIN32
and not
#ifdef WIN32
Johannes
References