From df0c18d835ad692899abe0fec23373e305a5f3ff Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Thu, 21 Apr 2005 21:05:05 +0000 Subject: [PATCH] MSVC build fixes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9851 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/ChangeLog | 6 ++++++ src/support/forkedcall.C | 4 +++- src/support/forkedcall.h | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 462269bfc5..5e6c69dd96 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,9 @@ +2005-04-21 Angus Leeming + + * forkedcall.h: define pid_t for MSVC. + + * forkedcall.C (kill): work around evil MSVC max macro. + 2005-04-21 Angus Leeming * forkedcontr.C: add #include . diff --git a/src/support/forkedcall.C b/src/support/forkedcall.C index 419fe5aac7..d1c840a275 100644 --- a/src/support/forkedcall.C +++ b/src/support/forkedcall.C @@ -180,7 +180,9 @@ void ForkedProcess::kill(int tol) return; } - int const tolerance = std::max(0, tol); + // The weird (std::max)(a,b) signature prevents expansion + // of an evil MSVC macro. + int const tolerance = (std::max)(0, tol); if (tolerance == 0) { // Kill it dead NOW! Murder::killItDead(0, pid()); diff --git a/src/support/forkedcall.h b/src/support/forkedcall.h index 9b4cc892fd..951b08d4cf 100644 --- a/src/support/forkedcall.h +++ b/src/support/forkedcall.h @@ -31,6 +31,11 @@ #include +// pid_t isn't defined by the stdlibs that ship with MSVC. +#if defined (_WIN32) && defined(_MSC_VER) +typedef int pid_t; +#endif + namespace lyx { namespace support { -- 2.39.2