summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-04-23 11:43:00 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2010-04-23 11:43:00 +0100
commitc4b0f6bcae4761cc7c41a2b07043a1bec00ad6e6 (patch)
tree48d9110b63e34c59c1648df3ff8a7049327bc487 /runtime
parent236c96ffb124074d6efe3382b4d1b77da9a2986a (diff)
parent3a12d05433153d5c7c84f85af6b5039fbcdd1d09 (diff)
downloadrsyslog-c4b0f6bcae4761cc7c41a2b07043a1bec00ad6e6.tar.gz
rsyslog-c4b0f6bcae4761cc7c41a2b07043a1bec00ad6e6.tar.xz
rsyslog-c4b0f6bcae4761cc7c41a2b07043a1bec00ad6e6.zip
Merge branch 'v4-devel' into master
Conflicts: runtime/rsyslog.h runtime/wtp.c
Diffstat (limited to 'runtime')
-rw-r--r--runtime/msg.c2
-rw-r--r--runtime/net.c8
-rw-r--r--runtime/rsyslog.h27
3 files changed, 23 insertions, 14 deletions
diff --git a/runtime/msg.c b/runtime/msg.c
index 215189ce..5885cada 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -3141,7 +3141,7 @@ static rsRetVal msgConstructFinalizer(msg_t *pThis)
* rgerhards, 2008-01-14
*/
static rsRetVal
-MsgGetSeverity(obj_t *pThis, int *piSeverity)
+MsgGetSeverity(obj_t_ptr pThis, int *piSeverity)
{
ISOBJ_TYPE_assert(pThis, msg);
assert(piSeverity != NULL);
diff --git a/runtime/net.c b/runtime/net.c
index 04ba5d91..7653ea1d 100644
--- a/runtime/net.c
+++ b/runtime/net.c
@@ -502,8 +502,8 @@ static inline void MaskIP4 (struct in_addr *addr, uint8_t bits) {
addr->s_addr &= htonl(0xffffffff << (32 - bits));
}
-#define SIN(sa) ((struct sockaddr_in *)(sa))
-#define SIN6(sa) ((struct sockaddr_in6 *)(sa))
+#define SIN(sa) ((struct sockaddr_in *)(void*)(sa))
+#define SIN6(sa) ((struct sockaddr_in6 *)(void*)(sa))
/* This is a cancel-safe getnameinfo() version, because we learned
@@ -1182,12 +1182,12 @@ void debugListenInfo(int fd, char *type)
switch(sa.sa_family) {
case PF_INET:
szFamily = "IPv4";
- ipv4 = (struct sockaddr_in*) &sa;
+ ipv4 = (struct sockaddr_in*)(void*) &sa;
port = ntohs(ipv4->sin_port);
break;
case PF_INET6:
szFamily = "IPv6";
- ipv6 = (struct sockaddr_in6*) &sa;
+ ipv6 = (struct sockaddr_in6*)(void*) &sa;
port = ntohs(ipv6->sin6_port);
break;
default:
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index bdbc0648..cc5c845e 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -91,6 +91,7 @@ typedef char intTiny; /* 0..127! */
typedef unsigned char uintTiny; /* 0..255! */
/* define some base data types */
+
typedef unsigned char uchar;/* get rid of the unhandy "unsigned char" */
typedef struct aUsrp_s aUsrp_t;
typedef struct thrdInfo thrdInfo_t;
@@ -112,15 +113,6 @@ typedef struct nsdsel_ptcp_s nsdsel_ptcp_t;
typedef struct nsdsel_gtls_s nsdsel_gtls_t;
typedef struct nsdpoll_ptcp_s nsdpoll_ptcp_t;
typedef struct wti_s wti_t;
-#ifdef OS_SOLARIS
- typedef void nsd_t;
- typedef void nsdsel_t;
- typedef void nsdpoll_t;
-#else
- typedef obj_t nsd_t;
- typedef obj_t nsdsel_t;
- typedef obj_t nsdpoll_t;
-#endif
typedef struct msg msg_t;
typedef struct queue_s qqueue_t;
typedef struct prop_s prop_t;
@@ -147,6 +139,23 @@ typedef uint64 qDeqID; /* queue Dequeue order ID. 32 bits is considered dangerou
typedef struct tcpLstnPortList_s tcpLstnPortList_t; // TODO: rename?
typedef struct strmLstnPortList_s strmLstnPortList_t; // TODO: rename?
+/* under Solaris (actually only SPARC), we need to redefine some types
+ * to be void, so that we get void* pointers. Otherwise, we will see
+ * alignment errors.
+ */
+#ifdef OS_SOLARIS
+ typedef void * obj_t_ptr;
+ typedef void nsd_t;
+ typedef void nsdsel_t;
+ typedef void nsdpoll_t;
+#else
+ typedef obj_t obj_t_ptr;
+ typedef obj_t nsd_t;
+ typedef obj_t nsdsel_t;
+ typedef obj_t nsdpoll_t;
+#endif
+
+
#ifdef __hpux
typedef unsigned int u_int32_t; /* TODO: is this correct? */
typedef int socklen_t;