fam
[Top] [All Lists]

[fam] fam-2.6.2 and gcc-2.95.2

To: fam@xxxxxxxxxxx
Subject: [fam] fam-2.6.2 and gcc-2.95.2
From: Sumit Bose <bose@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 10 Apr 2000 13:00:21 +0200
Sender: owner-fam@xxxxxxxxxxx
Hi,

the following two patches to Scheduler.h and Scheduler.c++ should prevent the 

Scheduler.h:97: ANSI C++ forbids data member `handler' with same name as 
enclosing class

error when using gcc-2.95.2. I have changed handler to xxx_handler (I am sure
that there will be a more sensible prefix than xxx_) and now everything works
fine for me.

I have also made a couple of changes to other files so that fam-oss-2.6.2 will
compile on IRIX5.3 with gcc-2.95.2 (most of them are missing include files and
missing functions in IRIX5.3), shall I also send them to this list?

Sumit

diff -Naur fam-oss-2.6.2/fam/Scheduler.h fam-oss-2.6.2-new/fam/Scheduler.h
--- fam-oss-2.6.2/fam/Scheduler.h       Thu Mar  2 01:51:24 2000
+++ fam-oss-2.6.2-new/fam/Scheduler.h   Wed Apr  5 14:57:37 2000
@@ -24,6 +24,7 @@
 #define Scheduler_included
 
 #include <sys/time.h>
+#include <bstring.h>
 
 #include "Boolean.h"
 
@@ -94,7 +95,7 @@
 
     struct FDInfo {
        struct handler {
-           IOHandler handler;
+           IOHandler xxx_handler;
            void *closure;
        } read, write;
     };



diff -Naur fam-oss-2.6.2/fam/Scheduler.c++ fam-oss-2.6.2-new/fam/Scheduler.c++
--- fam-oss-2.6.2/fam/Scheduler.c++     Thu Mar  2 01:51:20 2000
+++ fam-oss-2.6.2-new/fam/Scheduler.c++ Wed Apr  5 15:29:58 2000
@@ -232,7 +232,7 @@
 Scheduler::trim_fdinfo()
 {
     for (FDInfo *fp = &fdinfo[nfds - 1]; nfds > 0; --nfds, --fp)
-       if (fp->read.handler || fp->write.handler)
+       if (fp->read.xxx_handler || fp->write.xxx_handler)
            break;
 
     if (!nfds)
@@ -249,8 +249,8 @@
     assert(fd >= 0);
     assert(handler);
     FDInfo *fp = fd_to_info(fd);
-    IOHandler old_handler = (fp->*(iotype->iotype)).handler;
-    (fp->*(iotype->iotype)).handler = handler;
+    IOHandler old_handler = (fp->*(iotype->iotype)).xxx_handler;
+    (fp->*(iotype->iotype)).xxx_handler = handler;
     (fp->*(iotype->iotype)).closure = closure;
     assert(!old_handler || FD_ISSET(fd, &iotype->fds));
     if (!FD_ISSET(fd, &iotype->fds))
@@ -266,8 +266,8 @@
 {
     assert(fd >= 0 && fd < nfds);
     FDInfo *fp = fd_to_info(fd);
-    IOHandler old_handler = (fp->*(iotype->iotype)).handler;
-    (fp->*(iotype->iotype)).handler = NULL;
+    IOHandler old_handler = (fp->*(iotype->iotype)).xxx_handler;
+    (fp->*(iotype->iotype)).xxx_handler = NULL;
     (fp->*(iotype->iotype)).closure = NULL;
     trim_fdinfo();
     assert(old_handler);
@@ -311,7 +311,7 @@
            if (FD_ISSET(fd, fds))
            {   FDInfo *fp = &fdinfo[fd];
                assert(iotype == &FDInfo::read || iotype == &FDInfo::write);
-               (fp->*iotype).handler(fd, (fp->*iotype).closure);
+               (fp->*iotype).xxx_handler(fd, (fp->*iotype).closure);
                // Remember, handler may move fdinfo array.
            }
 }

--
Source code, list archive, and docs: http://oss.sgi.com/projects/fam/
To unsubscribe: echo unsubscribe fam | mail majordomo@xxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>