agent++ v3.5.8b changes for Visual C++ v6.0
Alexander Gutkin
sasha____rhetoricalsystems.com
Mon Jan 13 19:05:15 CET 2003
I had to make the following changes in order for the Agent++ code to
compile with Visual C++ v6.0:
1. A really tiny change to cmd_exe_mib example. SIGQUIT is not defined
on WIN32, so the dummy might be used:
--- DIFF BEGIN ---
diff -rc agent++/examples/cmd_exe_mib/src/agent.cpp agent++_3_5_8b_mine/examples/cmd_exe_mib/src/agent.cpp
*** agent++/examples/cmd_exe_mib/src/agent.cpp Fri Jan 3 12:23:59 2003
--- agent++_3_5_8b_mine/examples/cmd_exe_mib/src/agent.cpp Mon Jan 13
17:43:23 2003
***************
*** 117,123 ****
RequestList* requestList;
boolean run = TRUE;
!
static void sig(int signo)
{
if ((signo == SIGTERM) || (signo == SIGINT) ||
--- 117,127 ----
RequestList* requestList;
boolean run = TRUE;
! #if defined(WIN32)
! #define SIGDUMMY 500
! #define SIGQUIT (SIGDUMMY + 1)
! #endif // WIN32
!
static void sig(int signo)
{
if ((signo == SIGTERM) || (signo == SIGINT) ||
--- DIFF END ---
2. In addition, VC6 does not usually member functions declared
inline but implemented inline in a different translation unit. This
applies to MibTableRow class of mib.h. An obvious solution is to move
the implementation from mib.cpp into the header file mib.h. This results
in two changes: one to mib.h and another to mib.cpp:
--- DIFF BEGIN ---
diff -rc agent++/include/mib.h agent++_3_5_8b_mine/include/mib.h
*** agent++/include/mib.h Fri Jan 3 12:24:03 2003
--- agent++_3_5_8b_mine/include/mib.h Mon Jan 13 17:52:22 2003
***************
*** 887,893 ****
* @return TRUE if the receiver is less than the comparate,
* FALSE otherwise.
*/
! inline int operator<(const MibTableRow&);
/**
* Operator >
--- 887,895 ----
* @return TRUE if the receiver is less than the comparate,
* FALSE otherwise.
*/
! inline int operator<(const MibTableRow& other) {
! return (index < other.index);
! }
/**
* Operator >
***************
*** 896,902 ****
* @return TRUE if the receiver is greater than the comparate,
* FALSE otherwise.
*/
! inline int operator>(const MibTableRow&);
/**
* Operator ==
--- 898,906 ----
* @return TRUE if the receiver is greater than the comparate,
* FALSE otherwise.
*/
! inline int operator>(const MibTableRow& other) {
! return (index > other.index);
! }
/**
* Operator ==
***************
*** 905,911 ****
* @return TRUE if the receiver is equals the comparate,
* FALSE otherwise.
*/
! inline int operator==(const MibTableRow&);
/**
* Operator =
--- 909,917 ----
* @return TRUE if the receiver is equals the comparate,
* FALSE otherwise.
*/
! inline int operator==(const MibTableRow&) {
! return (index == other.index);
! }
/**
* Operator =
--- DIFF END ---
--- DIFF BEGIN ---
diff -rc agent++/src/mib.cpp agent++_3_5_8b_mine/src/mib.cpp
*** agent++/src/mib.cpp Fri Jan 3 12:23:51 2003
--- agent++_3_5_8b_mine/src/mib.cpp Mon Jan 13 17:38:08 2003
***************
*** 865,905 ****
row.overwriteNth(i, l);
}
- /**
- * Operator <
- *
- * @param other - The MibTableRow the receiver is compared with.
- * @return TRUE if the receiver is less than the comparate, FALSE
otherwise.
- */
-
- int MibTableRow::operator<(const MibTableRow& other)
- {
- return (index < other.index);
- }
-
- /**
- * Operator >
- *
- * @param other - The MibTableRow the receiver is compared with.
- * @return TRUE if the receiver is greater than the comparate, FALSE
otherwise.
- */
-
- int MibTableRow::operator>(const MibTableRow& other)
- {
- return (index > other.index);
- }
-
- /**
- * Operator ==
- *
- * @param other - The MibTableRow the receiver is compared with.
- * @return TRUE if the receiver is equals the comparate, FALSE
otherwise.
- */
-
- int MibTableRow::operator==(const MibTableRow& other)
- {
- return (index == other.index);
- }
/**
* Operator =
--- DIFF END ---
Applying these changes makes everything compile into a static
library for me.
Regards,
Alexander.
More information about the AGENTPP
mailing list