bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LynxOS 3.1.1 Port


From: Joel Sherrill
Subject: LynxOS 3.1.1 Port
Date: Fri, 07 Feb 2003 16:32:09 -0600

Hi,

I am entering the test phase of my port of Common C++ to LynxOS
3.1.1.  I am filing the appropriate paperwork with the FSF but
for now want to get some feedback on some porting issues and
how to do them more cleanly.  Right now, there are a handful
of __Lynx__ conditionals I want to eliminate.

(1) LynxOS has this prototype for sigwait() 

int sigwait            (sigset_t *, void **);

Currently, OST_CC_SIGNAL checks for 1 or 2 arguments to sigwait()
but the common 2 arg variety if not this one.  Any ideas on how to
detect it so I don't have to stoop to an ifdef on __Lynx__

(2) inet_aton(char *, .. )     not inet_aton(const char *, ..)
    gethostbyname(char *, .. ) not gethostbyname(const char *, ..)
    openlog(char *,..)         not openlog(const char *, ..)

Again how to detect and deal with this without stopping to 
ifdef __Lynx__.

(3) autoconf decides that LynxOS has PTHREAD_MUTEXTYPE_RECURSIVE
but LynxOS doesn't have pthread_mutexattr_settype().

(4) The structure used for SIOCGIFNETMASK around line 120
in src/network.cpp has different names in LynxOS:

#if defined(__Lynx__)
                        (InetAddress&)maskaddr =
((sockaddr_in&)devifreq).sin_addr;
#else
                        (InetAddress&)maskaddr =
((sockaddr_in&)devifreq.ifr_netmask).sin_addr;
#endif

(5) SIOCGIFMTU is not defined in LynxOS so I just set mtu.c in
src/network.cpp around line 128.

(6) In src/process.cpp and src/thread.cpp, signalexec_t has to be this:

#if defined(__Lynx__)
typedef RETSIGTYPE (*signalexec_t)(...);
#else
typedef RETSIGTYPE (*signalexec_t)(int);
#endif

The rest of the changes I managed to accomodate with autoconf macro
changes
or minor type changes to remove warnings.  I have attached the entire 
patch for review and comments.   I still have testing to go so I am
sure this is not the final iteration of it. :)

Thanks.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
address@hidden                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985
diff -u -r commoncpp2-1.0.7-orig/acconfig.h commoncpp2-1.0.7/acconfig.h
--- commoncpp2-1.0.7-orig/acconfig.h    Thu Nov 21 08:38:02 2002
+++ commoncpp2-1.0.7/acconfig.h Tue Feb  4 12:02:41 2003
@@ -83,6 +83,7 @@
 #undef HAVE_ARPA_INET_H
 #undef HAVE_NETINET_IN_SYSTM_H
 #undef HAVE_NETINET_IP_H
+#undef HAVE_BSD_IN_H
 #undef HAVE_SYS_UN_H
 #undef HAVE_SELECT_H
 #undef HAVE_SYS_SELECT_H
@@ -260,6 +261,12 @@
 #define        memmove(d, s, l)        memcpy(d, s, l)
 #endif
 
+#if defined(__Lynx__)
+#define HAVE_STRCASECMP
+int strcasecmp(const char *s1, const char *s2);
+int strncasecmp(const char *s1, const char *s2, size_t n);
+#endif
+
 #ifdef HAVE_STRCASECMP
 #ifndef stricmp
 #define stricmp(x,y) strcasecmp(x,y)
@@ -359,7 +366,9 @@
 #ifdef HAVE_PTHREAD_NANOSLEEP
 #ifndef HAVE_PTHREAD_DELAY
 #define HAVE_PTHREAD_DELAY
+#ifndef __Lynx__
 extern "C" int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
+#endif
 #define pthread_delay(x) nanosleep(x, NULL)
 #endif
 #endif
@@ -452,12 +461,20 @@
 #ifdef HAVE_NETINET_IP_H
 #include <netinet/ip.h>
 #endif
+#ifdef HAVE_BSD_IN_H
+#include <bsd/in.h>
+typedef u_long in_addr;
+#endif
 #ifdef HAVE_SYS_UN_H
 #include <sys/un.h>
 #endif
 #endif
 #endif
 
+#if defined(__Lynx__)
+#include <bsd/in.h>
+#endif
+
 #ifndef HAVE_INET_ATON
 #define inet_aton(cp, addr) \
        (((*(unsigned long int *)(addr)) = inet_addr(cp)) != -1)
@@ -487,6 +504,8 @@
 #ifdef HAVE_SOCKLEN_U
 #if !defined(__CYGWIN32__) && !defined(__MINGW32__)
 typedef unsigned socklen_t;
+#elif defined(__Lynx__)
+typedef unsigned int socklen_t;
 #else
 typedef int socklen_t;
 #endif
diff -u -r commoncpp2-1.0.7-orig/aclocal.m4 commoncpp2-1.0.7/aclocal.m4
--- commoncpp2-1.0.7-orig/aclocal.m4    Mon Nov 25 14:38:41 2002
+++ commoncpp2-1.0.7/aclocal.m4 Wed Jan 22 12:53:08 2003
@@ -156,6 +156,14 @@
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
+case $target in
+powerpc-xcoff-lynxos)
+  CFLAGS="$CFLAGS -mthreads"
+  ;;
+*-*-*)
+  ;;
+esac
+
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
@@ -4255,6 +4263,7 @@
 
 AC_DEFUN(OST_CC_STRING,[
        AC_REQUIRE([OST_SYS_POSIX])
+        AC_CHECK_FUNC(strcasecmp, , AC_CHECK_LIB(bsd, strcasecmp))
        AC_CHECK_FUNCS(strcasecmp strdup snprintf memmove)
        AC_CHECK_HEADERS(strings.h)
 ])
@@ -4287,7 +4296,6 @@
 dnl 
 dnl END ACCONFIG
 
-
 dnl Copyright (C) 1999-2001 Open Source Telecom Corporation.
 dnl  
 dnl This program is free software; you can redistribute it and/or modify
@@ -5251,6 +5259,8 @@
        AC_SUBST(XML_LIBS)
        AC_SUBST(XML_FLAGS)
 ])
+  ;;
+fi
 
 dnl ACCONFIG TEMPLATE
 dnl #undef HAVE_LIBXML
diff -u -r commoncpp2-1.0.7-orig/configure.in commoncpp2-1.0.7/configure.in
--- commoncpp2-1.0.7-orig/configure.in  Mon Nov 25 08:53:53 2002
+++ commoncpp2-1.0.7/configure.in       Wed Jan 22 12:53:14 2003
@@ -117,6 +117,23 @@
 
 AC_SUBST(BASE_LIB)
 
+### JOEL
+### AC_CHECK_HEADERS(bsd/in.h)
+
+### dnl ACCONFIG TEMPLATE
+### dnl #undef HAVE_BSD_IN_H
+### dnl END ACCONFIG
+### 
+### dnl ACCONFIG BOTTOM
+### dnl #ifdef HAVE_BSD_IN_H
+### dnl #include <bsd/in.h>
+### dnl typedef u_long in_addr;
+### dnl #endif
+### dnl END ACCONFIG
+### JOEL
+
+
+
 AC_OUTPUT(src/ccgnu2-config src/Makefile win32/Makefile m4/Makefile 
config/Makefile
 doc/Makefile demo/Makefile include/Makefile include/cc++/Makefile Makefile 
template/Makefile freebsd/pkg-plist
 pkginfo commoncpp2.spec freebsd/Makefile win32/CCXX2.rc tests/Makefile
@@ -132,5 +149,3 @@
 sed -e s!"@thrprefix@"!"$thrprefix"! -e s!"@USR_PREFIX@"!"$prefix"! \
        -e s!PACKAGE!CCXX_PACKAGE! -e s!VERSION!CCXX_VERSION! <config.tmp 
>config.h
 cd ../..
-
-
diff -u -r commoncpp2-1.0.7-orig/include/cc++/file.h 
commoncpp2-1.0.7/include/cc++/file.h
--- commoncpp2-1.0.7-orig/include/cc++/file.h   Thu Nov 21 08:33:07 2002
+++ commoncpp2-1.0.7/include/cc++/file.h        Wed Jan 22 11:35:55 2003
@@ -729,6 +729,14 @@
         * the disk file and wait for completion.  This assures the memory
         * mapped from the file is written back.
         */
+// LynxOS 3.1.1 did not define these :(
+#if defined(__Lynx__) 
+#if !defined(MS_SYNC)
+#define MS_ASYNC        1
+#define MS_INVALIDATE   2
+#define MS_SYNC         4
+#endif
+#endif 
        inline void sync(void)
                {msync(fcb.address, fcb.len, MS_SYNC);};
 
diff -u -r commoncpp2-1.0.7-orig/include/cc++/persist.h 
commoncpp2-1.0.7/include/cc++/persist.h
--- commoncpp2-1.0.7-orig/include/cc++/persist.h        Thu Nov 21 08:29:48 2002
+++ commoncpp2-1.0.7/include/cc++/persist.h     Wed Jan 22 13:02:00 2003
@@ -469,7 +469,7 @@
 Engine& operator <<( Engine& ar, typename std::vector<T> const& ob) THROWS 
(Engine::Exception)
 {
        ar << (uint32)ob.size();
-       for(uint i=0; i < ob.size(); ++i)
+       for(uint32 i=0; i < ob.size(); ++i)
                ar << ob[i];
        return ar;
 }
diff -u -r commoncpp2-1.0.7-orig/include/cc++/socket.h 
commoncpp2-1.0.7/include/cc++/socket.h
--- commoncpp2-1.0.7-orig/include/cc++/socket.h Thu Nov 21 08:33:07 2002
+++ commoncpp2-1.0.7/include/cc++/socket.h      Tue Feb  4 11:54:12 2003
@@ -50,6 +50,7 @@
 #include <cc++/config.h>
 #endif
 
+
 #ifndef        CCXX_THREAD_H_
 #include <cc++/thread.h>
 #endif
@@ -65,6 +66,13 @@
 typedef int SOCKET;
 #endif
 
+#if defined(__Lynx__)
+typedef int32_t socklen_t;
+#include <socket.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#endif
+
 #include <iostream>
 
 #ifndef        MSG_DONTWAIT
@@ -120,7 +128,7 @@
         * algorithm specific to derived classes.  
         */
        inline virtual void 
-       operator()(const in_addr address) const = 0;
+       operator()(const struct in_addr address) const = 0;
 };
 
 /**
@@ -144,7 +152,7 @@
         * specific to multicast addresses
         */
        inline void 
-       operator()(const in_addr address) const; 
+       operator()(const struct in_addr address) const; 
 private:
 #if __BYTE_ORDER == __BIG_ENDIAN
        enum {
diff -u -r commoncpp2-1.0.7-orig/include/config.h.in 
commoncpp2-1.0.7/include/config.h.in
--- commoncpp2-1.0.7-orig/include/config.h.in   Mon Nov 25 08:53:57 2002
+++ commoncpp2-1.0.7/include/config.h.in        Tue Feb  4 12:12:27 2003
@@ -101,6 +101,7 @@
 #undef HAVE_ARPA_INET_H
 #undef HAVE_NETINET_IN_SYSTM_H
 #undef HAVE_NETINET_IP_H
+#undef HAVE_BSD_IN_H
 #undef HAVE_SYS_UN_H
 #undef HAVE_SELECT_H
 #undef HAVE_SYS_SELECT_H
@@ -181,6 +182,9 @@
 /* Define if you have the <netinet/ip.h> header file.  */
 #undef HAVE_NETINET_IP_H
 
+/* Define if you have the <bsd/in.h> header file.  */
+#undef HAVE_BSD_IN_H
+
 /* Define if you have the <poll.h> header file.  */
 #undef HAVE_POLL_H
 
@@ -421,6 +425,12 @@
 #define        memmove(d, s, l)        memcpy(d, s, l)
 #endif
 
+#if defined(__Lynx__)
+#define HAVE_STRCASECMP
+int strcasecmp(const char *s1, const char *s2);
+int strncasecmp(const char *s1, const char *s2, size_t n);
+#endif
+
 #ifdef HAVE_STRCASECMP
 #ifndef stricmp
 #define stricmp(x,y) strcasecmp(x,y)
@@ -520,7 +530,9 @@
 #ifdef HAVE_PTHREAD_NANOSLEEP
 #ifndef HAVE_PTHREAD_DELAY
 #define HAVE_PTHREAD_DELAY
+#ifndef __Lynx__
 extern "C" int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
+#endif
 #define pthread_delay(x) nanosleep(x, NULL)
 #endif
 #endif
@@ -613,12 +625,20 @@
 #ifdef HAVE_NETINET_IP_H
 #include <netinet/ip.h>
 #endif
+#ifdef HAVE_BSD_IN_H
+#include <bsd/in.h>
+typedef u_long in_addr;
+#endif
 #ifdef HAVE_SYS_UN_H
 #include <sys/un.h>
 #endif
 #endif
 #endif
 
+#if defined(__Lynx__)
+#include <bsd/in.h>
+#endif
+
 #ifndef HAVE_INET_ATON
 #define inet_aton(cp, addr) \
        (((*(unsigned long int *)(addr)) = inet_addr(cp)) != -1)
@@ -711,4 +731,19 @@
 #define        ETC_PREFIX "/etc/"
 #endif
 
+/* provide prototypes for present routines without them */
+#if defined(__Lynx__)
+// should be in stdio.h 
+int snprintf(char *str, size_t size, const  char  *format, ...);
+
+// should be prototyped in stdlib.h 
+int putenv(char *string);
+
+// should be prototyped in unistd.h 
+pid_t vfork(void);
+
+// should be in sys/file.h
+int lockf(int fd, int cmd, off_t len);
+#endif
+
 #endif
diff -u -r commoncpp2-1.0.7-orig/m4/ost_socket.m4 
commoncpp2-1.0.7/m4/ost_socket.m4
--- commoncpp2-1.0.7-orig/m4/ost_socket.m4      Thu May 30 07:10:15 2002
+++ commoncpp2-1.0.7/m4/ost_socket.m4   Wed Jan 22 09:01:55 2003
@@ -26,7 +26,7 @@
        ost_cv_lib_socket="c"
        SOCKET_LIBS=""
        AC_CHECK_HEADERS(sys/socket.h,[
-               AC_CHECK_HEADERS(select.h sys/select.h netinet/in_systm.h 
netinet/ip.h)
+               AC_CHECK_HEADERS(select.h sys/select.h netinet/in_systm.h 
netinet/ip.h bsd/in.h)
                AC_CHECK_HEADERS(arpa/inet.h,
                        ost_cv_inet_sockets=yes)
                AC_CHECK_HEADERS(sys/un.h,
@@ -66,6 +66,7 @@
 dnl #undef HAVE_ARPA_INET_H
 dnl #undef HAVE_NETINET_IN_SYSTM_H
 dnl #undef HAVE_NETINET_IP_H
+dnl #undef HAVE_BSD_IN_H
 dnl #undef HAVE_SYS_UN_H
 dnl #undef HAVE_SELECT_H
 dnl #undef HAVE_SYS_SELECT_H
diff -u -r commoncpp2-1.0.7-orig/m4/ost_systime.m4 
commoncpp2-1.0.7/m4/ost_systime.m4
--- commoncpp2-1.0.7-orig/m4/ost_systime.m4     Fri Feb 22 04:11:32 2002
+++ commoncpp2-1.0.7/m4/ost_systime.m4  Tue Feb  4 10:30:11 2003
@@ -20,8 +20,8 @@
 dnl distribution terms that you use for the rest of that program.
 
 AC_DEFUN(OST_HEADER_SYSTIME,[
-       AC_HEADER_TIME
-       AC_CHECK_HEADERS(sys/time.h)
+     AC_HEADER_TIME
+     AC_CHECK_HEADERS(sys/time.h)
 ])
 
 dnl ACCONFIG TEMPLATE
diff -u -r commoncpp2-1.0.7-orig/src/file.cpp commoncpp2-1.0.7/src/file.cpp
--- commoncpp2-1.0.7-orig/src/file.cpp  Sat Nov  9 23:19:36 2002
+++ commoncpp2-1.0.7/src/file.cpp       Tue Feb  4 12:12:29 2003
@@ -490,7 +490,7 @@
 #else
        enterMutex();
        lseek(fd, fcb->pos, SEEK_SET);
-       io = ::read(fd, fcb->address, fcb->len);
+       int io = ::read(fd, fcb->address, fcb->len);
        leaveMutex();
 #endif
 
@@ -551,7 +551,7 @@
 #else
        enterMutex();
        lseek(fd, fcb->pos, SEEK_SET);
-       io = ::write(fd, fcb->address, fcb->len);
+       int io = ::write(fd, fcb->address, fcb->len);
        leaveMutex();
 #endif
 
diff -u -r commoncpp2-1.0.7-orig/src/friends.cpp 
commoncpp2-1.0.7/src/friends.cpp
--- commoncpp2-1.0.7-orig/src/friends.cpp       Mon Aug 12 09:22:20 2002
+++ commoncpp2-1.0.7/src/friends.cpp    Tue Feb  4 11:06:30 2003
@@ -47,7 +47,12 @@
 
 #ifndef WIN32
 
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#else
+#include <time.h>
+#endif
+
 #ifdef SIGTSTP
 #include <sys/file.h>
 #include <sys/ioctl.h>
@@ -108,7 +113,11 @@
        sigemptyset(&mask);
        sigaddset(&mask, signo);
 #ifdef HAVE_SIGWAIT2
+#if defined(__Lynx__)
+       sigwait(&mask, (void **)&signo);
+#else
        sigwait(&mask, &signo);
+#endif
 #else
        sigwait(&mask);
 #endif
diff -u -r commoncpp2-1.0.7-orig/src/inaddr.cpp commoncpp2-1.0.7/src/inaddr.cpp
--- commoncpp2-1.0.7-orig/src/inaddr.cpp        Wed May  8 18:18:30 2002
+++ commoncpp2-1.0.7/src/inaddr.cpp     Tue Feb  4 12:11:36 2003
@@ -254,7 +254,11 @@
 #else
        struct in_addr l_addr;
        
+#if defined(__Lynx__)
+       int ok = inet_aton((char *)host, &l_addr);
+#else
        int ok = inet_aton(host, &l_addr);
+#endif
        if ( validator )
                (*validator)(l_addr);
        if ( !ok )
@@ -293,7 +297,11 @@
                hp = gethostbyname(host);
 #else
                mutex.enterMutex();
+#if defined(__Lynx__)
+               hp = gethostbyname((char *)host);
+#else
                hp = gethostbyname(host);
+#endif
                mutex.leaveMutex();
 #endif
                if(!hp)
diff -u -r commoncpp2-1.0.7-orig/src/mutex.cpp commoncpp2-1.0.7/src/mutex.cpp
--- commoncpp2-1.0.7-orig/src/mutex.cpp Wed May  8 18:18:30 2002
+++ commoncpp2-1.0.7/src/mutex.cpp      Tue Feb  4 11:01:53 2003
@@ -163,8 +163,10 @@
 
        pthread_mutexattr_init(&_attr);
 #ifdef PTHREAD_MUTEXTYPE_RECURSIVE
+#ifndef __Lynx__
        pthread_mutexattr_settype(&_attr, PTHREAD_MUTEXTYPE_RECURSIVE);
 #endif
+#endif
        pthread_mutex_init(&_mutex, &_attr);
        pthread_mutexattr_destroy(&_attr);
 
diff -u -r commoncpp2-1.0.7-orig/src/network.cpp 
commoncpp2-1.0.7/src/network.cpp
--- commoncpp2-1.0.7-orig/src/network.cpp       Mon Nov 25 08:54:27 2002
+++ commoncpp2-1.0.7/src/network.cpp    Wed Jan 22 12:30:47 2003
@@ -113,15 +113,26 @@
                else
                        (InetAddress&)brdaddr = 
((sockaddr_in&)devifreq.ifr_broadaddr).sin_addr;
 
+
                if(ioctl(fd, SIOCGIFNETMASK, &devifreq) == -1)
                        maskaddr = htonl(INADDR_BROADCAST);
                else
+#if defined(__Lynx__)
+                       (InetAddress&)maskaddr = 
((sockaddr_in&)devifreq).sin_addr;
+#else
                        (InetAddress&)maskaddr = 
((sockaddr_in&)devifreq.ifr_netmask).sin_addr;
+#endif
+
 
+               // SIOCGIFMTU not defined
+#if defined(__Lynx__)
+               mtu = 0;
+#else
                if(ioctl(fd, SIOCGIFMTU, &devifreq) == -1)
                        mtu = 0;
                else
                        mtu = devifreq.ifr_mtu;
+#endif
 
                devs.push_back(NetworkDeviceInfo(ifc.ifc_req[i].ifr_name, addr, 
brdaddr, maskaddr, mtu));
        }
diff -u -r commoncpp2-1.0.7-orig/src/process.cpp 
commoncpp2-1.0.7/src/process.cpp
--- commoncpp2-1.0.7-orig/src/process.cpp       Thu Nov 21 08:33:07 2002
+++ commoncpp2-1.0.7/src/process.cpp    Tue Feb  4 12:12:00 2003
@@ -46,7 +46,12 @@
 #include <cstdio>
 
 #ifndef        WIN32
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#else
+#include <time.h>
+#endif
+
 #include <sys/wait.h>
 
 #ifdef SIGTSTP
@@ -68,6 +73,12 @@
 namespace ost {
 #endif
 
+#if defined(__Lynx__)
+typedef        RETSIGTYPE (*signalexec_t)(...);
+#else
+typedef        RETSIGTYPE (*signalexec_t)(int);
+#endif
+
 #ifdef WIN32
 int Process::spawn(const char *exename, const char **args)
 {
@@ -105,7 +116,7 @@
 {
        struct  sigaction       sig_act, old_act;
 
-       sig_act.sa_handler = func;
+       sig_act.sa_handler = (signalexec_t)func;
        sigemptyset(&sig_act.sa_mask);
        if(signo != SIGALRM)
                sigaddset(&sig_act.sa_mask, SIGALRM);
@@ -124,7 +135,7 @@
 {
        struct  sigaction       sig_act, old_act;
 
-       sig_act.sa_handler = func;
+       sig_act.sa_handler = (signalexec_t)func;
        sigemptyset(&sig_act.sa_mask);
        sig_act.sa_flags = 0;
        if(signo == SIGALRM)
@@ -207,7 +218,7 @@
                if(getenv(strbuf))
                        return;
 
-       ::putenv(strbuf);
+       putenv(strbuf);
 #endif
 }
 
diff -u -r commoncpp2-1.0.7-orig/src/serial.cpp commoncpp2-1.0.7/src/serial.cpp
--- commoncpp2-1.0.7-orig/src/serial.cpp        Sat Nov  9 23:19:37 2002
+++ commoncpp2-1.0.7/src/serial.cpp     Wed Jan 22 12:34:04 2003
@@ -314,7 +314,10 @@
        if(size > max)
                size = max;
 
-       attr->c_cc[VEOL] = attr->c_cc[VEOL2] = 0;
+       attr->c_cc[VEOL] = 0;
+#if defined(VEOL2)                    // LynxOS doesn't appear to have this
+       attr->c_cc[VEOL2] = 0;
+#endif
        attr->c_cc[VMIN] = (unsigned char)size;
        attr->c_cc[VTIME] = btimer;
        attr->c_lflag &= ~ICANON;
@@ -334,7 +337,9 @@
        struct termios *attr = (struct termios *)current;
        attr->c_cc[VMIN] = attr->c_cc[VTIME] = 0;
        attr->c_cc[VEOL] = newline;
+#if defined(VEOL2)                    // LynxOS doesn't appear to have this
        attr->c_cc[VEOL2] = nl1;
+#endif
        attr->c_lflag |= ICANON;
        tcsetattr(dev, TCSANOW, attr);
 #ifdef _PC_MAX_CANON
diff -u -r commoncpp2-1.0.7-orig/src/slog.cpp commoncpp2-1.0.7/src/slog.cpp
--- commoncpp2-1.0.7-orig/src/slog.cpp  Sun Jun 23 23:53:29 2002
+++ commoncpp2-1.0.7/src/slog.cpp       Tue Feb  4 11:33:08 2003
@@ -163,7 +163,11 @@
                fac = LOG_USER;
                break;
        }
+#if defined(__Lynx__)
+       openlog((char *)ident, 0, fac);
+#else
        openlog(ident, 0, fac);
+#endif
 #else
        lock.enterMutex();
        syslog.close();
diff -u -r commoncpp2-1.0.7-orig/src/thread.cpp commoncpp2-1.0.7/src/thread.cpp
--- commoncpp2-1.0.7-orig/src/thread.cpp        Sat Nov  9 23:19:37 2002
+++ commoncpp2-1.0.7/src/thread.cpp     Tue Feb  4 10:52:51 2003
@@ -71,7 +71,11 @@
 
 #ifndef WIN32
 typedef        void    *(*exec_t)(void *);
+#if defined(__Lynx__)
+typedef        RETSIGTYPE (*signalexec_t)(...);
+#else
 typedef        RETSIGTYPE (*signalexec_t)(int);
+#endif
 extern "C"
 {
 #ifndef CCXX_SIG_THREAD_STOPCONT
@@ -236,8 +240,13 @@
        while ( (getThread()->priv->_suspendcount) > 0)
        {
 #ifdef HAVE_SIGWAIT2
+#if defined(__Lynx__)
+               void *return_info;
+               sigwait(&sigs, &return_info);
+#else
                int signo;
                sigwait(&sigs, &signo);
+#endif
 #else
                sigwait(&sigs);
 #endif
@@ -418,7 +427,7 @@
 # endif                
 
 # if CCXX_SUSPEND_MODE == CCXX_SUSPEND_MODE_ONE_SIGNAL
-               act.sa_handler = ccxx_sigsuspend;
+               act.sa_handler = (signalexec_t)ccxx_sigsuspend;
                sigemptyset(&act.sa_mask);
 #  ifdef       SA_RESTART
                act.sa_flags = SA_RESTART;
@@ -1336,8 +1345,12 @@
 #ifndef HAVE_SIGWAIT2
        signo = sigwait(&mask);
 #else
+#if defined(__Lynx__)
+       sigwait(&mask, (void **)&signo);
+#else
        sigwait(&mask, &signo);
 #endif
+#endif
 }
 
 void   PosixThread::setSignal(int signo, bool mode)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]