Changeset 9991 for source/ariba/utility


Ignore:
Timestamp:
Jul 28, 2011, 2:03:14 PM (13 years ago)
Author:
Christoph Mayer
Message:

-fixes on protlib for android

Location:
source/ariba/utility/transport/tcpip/protlib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/transport/tcpip/protlib/address.cpp

    r9686 r9991  
    9191          Log(DEBUG_LOG,LOG_NORMAL,"hostaddress","::operator==()" << haddr->get_ip_str()<<"=="<<this->get_ip_str());
    9292          if (!ipv4flag)
    93             Log(DEBUG_LOG,LOG_NORMAL,"hostaddress","::operator==(), v6=" << IN6_ARE_ADDR_EQUAL(ipv6addr.s6_addr, haddr->ipv6addr.s6_addr));
     93            Log(DEBUG_LOG,LOG_NORMAL,"hostaddress","::operator==(), v6=" << IN6_ARE_ADDR_EQUAL(&ipv6addr, &(haddr->ipv6addr)));
    9494#endif
    9595          return ipv4flag ? (ipv4addr.s_addr==haddr->ipv4addr.s_addr) :
    96                             IN6_ARE_ADDR_EQUAL(ipv6addr.s6_addr, haddr->ipv6addr.s6_addr);
     96                            IN6_ARE_ADDR_EQUAL(&ipv6addr, &(haddr->ipv6addr));
    9797        } else return false;
    9898} // end operator==
     
    177177bool hostaddress::is_ip_unspec() const {
    178178        if (ipv4flag) return (ipv4addr.s_addr==0);
    179         else return IN6_IS_ADDR_UNSPECIFIED(ipv6addr.s6_addr);
     179        else return IN6_IS_ADDR_UNSPECIFIED(&ipv6addr);
    180180        // never reached
    181181        return true;
     
    225225                in = ipv4addr;
    226226                return true;
    227         } else if (IN6_IS_ADDR_V4MAPPED(ipv6addr.s6_addr)) {
     227        } else if (IN6_IS_ADDR_V4MAPPED(&ipv6addr)) {
    228228                memcpy(&(in.s_addr),ipv6addr.s6_addr+12,4);
    229229                return true;
  • source/ariba/utility/transport/tcpip/protlib/address.h

    r9686 r9991  
    13061306hostaddress::is_mapped_ip() const
    13071307{
    1308   return (ipv4flag) ? false : IN6_IS_ADDR_V4MAPPED(ipv6addr.s6_addr);
     1308  return (ipv4flag) ? false : IN6_IS_ADDR_V4MAPPED(&ipv6addr);
    13091309} // end is_mapped_ip
    13101310
  • source/ariba/utility/transport/tcpip/protlib/eclock_gettime.c

    r9686 r9991  
    3838/* struct timezone tz = { 0, DST_NONE }; */
    3939static struct timeval tv;
    40 typedef int             clockid_t;
    4140
    4241/* syntax for clock_gettime:
  • source/ariba/utility/transport/tcpip/protlib/fastqueue.c

    r9686 r9991  
    5858#define qerr(errnr)      fprintf(stderr,"queue.c: %s\n",queue_errmsg[errnr])
    5959
    60 #ifdef __linux__
    61 
    62 // not needed for Linux
    63 //#define pthread_mutexattr_settype pthread_mutexattr_setkind_np
    6460
    6561#define PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_TIMED_NP
     
    7470#define clock_gettime(clock_id, tspec) eclock_gettime(tspec)
    7571
    76 #elif _DECTHREADS_VERSION < 314126L
    77 
    78 #define pthread_mutexattr_settype pthread_mutexattr_settype_np
    79 #define PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_NORMAL_NP
    80 #define PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK_NP
    81 #endif
    8272                 /*************** typedefs *****************/
    8373
  • source/ariba/utility/transport/tcpip/protlib/logfile.h

    r9686 r9991  
    5353namespace log {
    5454
    55     static const pthread_mutex_t initlogmutex=
    56 #ifdef _DEBUG
    57   // PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; // use this for debugging, it will return errors on potential deadlock situations
    58   PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
    59 #else // should be recursive mutex because sometimes error log output sometimes occurs
    60   // while objects contents are logged
    61   PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; // PTHREAD_MUTEX_INITIALIZER;
    62 #endif
     55static const pthread_mutex_t initlogmutex=
     56    #ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
     57                PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
     58    #else
     59        PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
     60    #endif
    6361
    6462#undef ERROR_LOG
  • source/ariba/utility/transport/tcpip/protlib/threads.h

    r9686 r9991  
    7171template <class T> void *thread_starter(void *thread_object) {
    7272
     73#ifdef PTHREAD_CANCEL_ENABLE
    7374        pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
     75#endif
     76#ifdef PTHREAD_CANCEL_DEFERRED
    7477        pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
     78#endif
    7579
    7680        (static_cast<T*>(thread_object))->start_processing();
     
    537541                thread_object.unlock();
    538542                if (kill) {
     543
     544#ifdef PTHREAD_CANCEL_ENABLE
    539545                        for (unsigned i = 0; i < pthreads.size(); i++)
    540546                                pthread_cancel( pthreads[i] );
    541547
    542548                        sleepuntilstop();
     549#endif
    543550
    544551                        for (unsigned i = 0; i < pthreads.size(); i++)
  • source/ariba/utility/transport/tcpip/protlib/tp_over_udp.cpp

    r9686 r9991  
    4141#include <arpa/inet.h>          /* inet_addr */
    4242
     43#ifndef IPPROTO_IPV6
     44        // v6 structs not defined in netinet/in.h, pull in here
     45        #include <linux/ipv6.h>
     46#endif
     47
    4348#include <fcntl.h>
    4449#include <sys/poll.h>
Note: See TracChangeset for help on using the changeset viewer.