SNMP++ 3.2.1c/Agent++ 3.5.6b with AIX and Cygwin - patches

Meibusch, David David_Meibusch____adc.com
Fri Oct 18 08:44:02 CEST 2002


Frank,
I've been using SNMP++ and Agent++ for some time now. Great work, and thank you.
I thought I better give something back. :-)

Currently I've ported my agent to HP-UX, Solaris, AIX and cygwin.
Based on SNMP++ 3.2.1c and Agent++ 3.5.6b here are the diffs for building on cygwin and AIX.
I've built with GCC 3.2.x on all platforms and I've included a dump of config for each platform below also.

SNMP++
$ diff include/address.h include/address.h.orig
89,94c89
< #if defined _AIX
< // This is needed for FD_SET, bzero
< #include <strings.h>
< #endif
<
< #if !defined __CYGWIN32__ && !defined __hpux && !defined linux && !defined _AIX
---
> #if !defined __CYGWIN32__ && !defined __hpux && !defined linux

$ diff src/notifyqueue.cpp src/notifyqueue.cpp.orig
368c368
< #if defined sun || defined _AIX || defined __CYGWIN__
---
> #ifdef sun

$ diff src/uxsnmp.cpp src/uxsnmp.cpp.orig
292c292
< #if defined linux || defined __FreeBSD__ || defined _AIX
---
> #if defined linux || defined __FreeBSD__
415c415
< #if defined linux || defined __FreeBSD__ || defined _AIX
---
> #if defined linux || defined __FreeBSD__

Agent++
$ diff src/threads.cpp src/threads.cpp.orig
678d677
< #if defined(_POSIX_TIMERS)
686,690d684
< #else
<       unsigned int micros = secs*1000 + nanos/1000;
<
<       if ((int) usleep(micros) == -1) {
< #endif
<

Now, I'm not sure of the historical reason for the code below to target certain versions of GCC.
As you can see from my change, I found the enabling of namespaces for GCC 3.2.1 unnecessary.

$ diff include/agent++.h include/agent++.h.orig
186c186
< #if ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 91))
---
> #if (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 91))

My builds of GCC are listed below.
On cygwin:
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.2/specs
Configured with: /netrel/src/gcc-3.2-1/configure --enable-languages=c,c++,f77,java --enable-libgcj --enable-threads=posix --with-system-zlib --enable-nls --without-included-gettext --enable-interpreter --disable-sjlj-exceptions --disable-version-specific-runtime-libs --enable-shared --build=i686-pc-linux --host=i686-pc-cygwin --target=i686-pc-cygwin --enable-haifa --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --includedir=/nonexistent/include --libexecdir=/usr/sbin
Thread model: posix
gcc version 3.2 20020818 (prerelease)

On HP-UX 11i:
Reading specs from /usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.2/specs
Configured with: ../configure --enable-languages=c,c++ --with-gnu-as --with-as=/opt/binutils/bin/as --enable-shared --enable-threads=posix
Thread model: posix
gcc version 3.2

On AIX 4.3:
Reading specs from /u01/app/gcc-3.2/lib/gcc-lib/powerpc-ibm-aix4.3.3.0/3.2/specs
Configured with: ../configure --prefix=/u01/app/gcc-3.2 --exec-prefix=/u01/app/gcc-3.2 --enable-languages=c,c++ --enable-threads=posix --enable-shared -disable-nls
Thread model: aix
gcc version 3.2

cheers
Dave

David Meibusch
Architect
ADC Software System Division - Tech Office
+61.7.3218.8726 (tel)

Learn about ADC - The Broadband Company at http://www.adc.com 





More information about the AGENTPP mailing list