From 17e5a0b98d274425576e54132f19dac8e6a1a23c Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 19 Sep 2002 22:11:47 +0000 Subject: [PATCH] fixed visual c++ 6.0 build issues --- documentation/KnownProblems.html | 60 +++++++++++++++++++----------- src/ca/nciu.cpp | 5 +-- src/ca/nciu.h | 2 +- src/libCom/osi/os/WIN32/osdEvent.c | 6 ++- src/libCom/osi/os/WIN32/osdMutex.c | 7 +++- 5 files changed, 51 insertions(+), 29 deletions(-) diff --git a/documentation/KnownProblems.html b/documentation/KnownProblems.html index 973d7f1a2..39f481c29 100644 --- a/documentation/KnownProblems.html +++ b/documentation/KnownProblems.html @@ -20,33 +20,51 @@ for details about TIMEZONE.

GNU make version

GNU make version 3.78.1 or later is required for builds. The README.html -file specifies version 3.70 but this version does not support the call function. - +file specifies version 3.70 but this version does not support the call +function.

Borland build

-

The borland-x86 build of base fails in src/ca because the Borland compiler v5.5 -does not support C++ placement delete. A fix is to add the following code after the -#include lines in ca/netIO.h and ca/syncGroup.h.

+

The borland-x86 build of base fails in src/ca because the Borland compiler +v5.5 does not support C++ placement delete. A fix is to add the following +code after the #include lines in ca/netIO.h and ca/syncGroup.h.

-// does the local compiler support placement delete
-#if defined (_MSC_VER)
-# if _MSC_VER >= 1200
-# define NETIO_PLACEMENT_DELETE
-# endif
-#elif defined ( __HP_aCC )
-# if _HP_aCC > 033300
-# define NETIO_PLACEMENT_DELETE
-# endif
-#elif defined ( __BORLANDC__ )
-# if __BORLANDC__ > 0x550
-# define NETIO_PLACEMENT_DELETE
-# endif
-#else
-# define NETIO_PLACEMENT_DELETE
-#endif
+ // does the local compiler support placement delete
+ #if defined (_MSC_VER)
+ # if _MSC_VER >= 1200
+ # define NETIO_PLACEMENT_DELETE
+ # endif
+ #elif defined ( __HP_aCC )
+ # if _HP_aCC > 033300
+ # define NETIO_PLACEMENT_DELETE
+ # endif
+ #elif defined ( __BORLANDC__ )
+ # if __BORLANDC__ > 0x550
+ # define NETIO_PLACEMENT_DELETE
+ # endif
+ #else
+ # define NETIO_PLACEMENT_DELETE
+ #endif
+

Visual C++ 6.0 Build

+ +

The order of certain Microsoft header file includes must be rearranged as +follows in base/src/osi/os/win32/osdMutex.c and possibly also +base/src/libCom/osi/os/win32/osdEvent.c. This problem does not exist with +Visual C++ 7.0 (visual C++ .net).

+ +

// visual c++ 6.0 appears to be sensitive to the

+ +

// order of the following four lines

+ +

#define VC_EXTRALEAN

+ +

#define _WIN32_WINNT 0x400

+ +

#include <windows.h>

+ +

#include <winsock2.h>

diff --git a/src/ca/nciu.cpp b/src/ca/nciu.cpp index ab03fd90d..dc0ca29cf 100644 --- a/src/ca/nciu.cpp +++ b/src/ca/nciu.cpp @@ -70,9 +70,8 @@ nciu::nciu ( cac & cacIn, netiiu & iiuIn, cacChannelNotify & chanIn, this->nameLength = static_cast ( nameLengthTmp ); - char * pTmpNameStr = new char [ this->nameLength ]; - strcpy ( pTmpNameStr, pNameIn ); - this->pNameStr = pTmpNameStr; + this->pNameStr = new char [ this->nameLength ]; + strcpy ( this->pNameStr, pNameIn ); } nciu::~nciu () diff --git a/src/ca/nciu.h b/src/ca/nciu.h index b11d855fc..dddb29f76 100644 --- a/src/ca/nciu.h +++ b/src/ca/nciu.h @@ -101,7 +101,7 @@ public: private: caAccessRights accessRightState; cac & cacCtx; - const char * pNameStr; + char * pNameStr; netiiu * piiu; ca_uint32_t sid; // server id unsigned count; diff --git a/src/libCom/osi/os/WIN32/osdEvent.c b/src/libCom/osi/os/WIN32/osdEvent.c index ed1841072..9c7727d3b 100644 --- a/src/libCom/osi/os/WIN32/osdEvent.c +++ b/src/libCom/osi/os/WIN32/osdEvent.c @@ -20,9 +20,11 @@ #include +// visual c++ 6.0 appears to be sensitive to the +// order of the following #define VC_EXTRALEAN -/* including less than this causes conflicts with winsock2.h :-( */ -#define _WIN32_WINNT 0x400 +#define _WIN32_WINNT 0x400 // currently not needed +#include #include #define epicsExportSharedSymbols diff --git a/src/libCom/osi/os/WIN32/osdMutex.c b/src/libCom/osi/os/WIN32/osdMutex.c index de9cda3d9..a0dfbf1e5 100644 --- a/src/libCom/osi/os/WIN32/osdMutex.c +++ b/src/libCom/osi/os/WIN32/osdMutex.c @@ -18,12 +18,16 @@ * */ + + #include #include +// visual c++ 6.0 appears to be sensitive to the +// order of the following #define VC_EXTRALEAN -/* including less than this causes conflicts with winsock2.h :-( */ #define _WIN32_WINNT 0x400 +#include #include #define epicsExportSharedSymbols @@ -308,4 +312,3 @@ epicsShareFunc void epicsShareAPI epicsMutexShow ( epicsMutexId pSem, unsigned l } } -