From 2bddbfeedc43e0f79fdcdbc63a1b3e4ec2f5877d Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 18 Feb 1998 22:52:22 +0000 Subject: [PATCH] fixed to run on both vis C++ 5.0 and g++ --- src/gdd/gddAppFuncTable.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/gdd/gddAppFuncTable.h b/src/gdd/gddAppFuncTable.h index 6327f3eb6..0bef4372d 100644 --- a/src/gdd/gddAppFuncTable.h +++ b/src/gdd/gddAppFuncTable.h @@ -29,6 +29,9 @@ * * History * $Log$ + * Revision 1.6 1998/02/05 22:47:46 jhill + * workaround vis C++ 5.0 bug + * * Revision 1.5 1997/06/25 06:17:36 jhill * fixed warnings * @@ -97,21 +100,20 @@ public: } // - // Both cases below are correct C++ syntax. - // (compiler quality varies) + // Both cases below are correct C++ syntax // -#if _MSC_VER == 1100 - // - // required by MS vis c++ 5.0 (but not by 4.0 or 4.2) - // - typedef gddAppFuncTableStatus (PV::*gddAppFuncTablePMF_t)(gdd &); -# define gddAppFuncTablePMF(VAR) gddAppFuncTablePMF_t VAR -#else +#if __GNUG__ // // required by gnu g++ 2.7.2 // # define gddAppFuncTablePMF(VAR) gddAppFuncTableStatus (PV:: * VAR)(gdd &) -# define gddAppFuncTablePMF_t ((PV:: *)(gdd &)) +# define gddAppFuncTablePMF_t (gddAppFuncTableStatus (PV::*)(gdd &)) +#else + // + // required by MS vis c++ and also sun pro c++ + // + typedef gddAppFuncTableStatus (PV::*gddAppFuncTablePMF_t)(gdd &); +# define gddAppFuncTablePMF(VAR) gddAppFuncTablePMF_t VAR #endif // @@ -253,13 +255,12 @@ void gddAppFuncTable::newTbl(unsigned newApplTypeMax) return; } maxApp = newApplTypeMax+(1u<<6u); -# if _MSC_VER < 1100 +# if defined(_MSC_VER) && (_MSC_VER<1100) // - // Right now all MS Visual C++ compilers allocate the + // MS Visual C++ 4.0 or lower compilers allocate the // wrong amount of memory (i.e. too little) // for member function pointers, // only explicit calculation via sizeof() works. - // For future versions this may become "if _MSC_VER < ???"... // pMNewFuncTbl = (gddAppFuncTablePMF(*)) new char[sizeof(gddAppFuncTablePMF_t) * maxApp];