From 3a12d05433153d5c7c84f85af6b5039fbcdd1d09 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 22 Apr 2010 14:38:12 +0100 Subject: solved alignment errors on Solaris Sparc --- runtime/rsyslog.h | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'runtime/rsyslog.h') diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h index acc31a99..b7117029 100644 --- a/runtime/rsyslog.h +++ b/runtime/rsyslog.h @@ -60,12 +60,8 @@ #endif -/* 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. -*/ - /* define some base data types */ + typedef unsigned char uchar;/* get rid of the unhandy "unsigned char" */ typedef struct thrdInfo thrdInfo_t; typedef struct obj_s obj_t; @@ -83,13 +79,6 @@ typedef struct nsd_gsspi_s nsd_gsspi_t; typedef struct nsd_nss_s nsd_nss_t; typedef struct nsdsel_ptcp_s nsdsel_ptcp_t; typedef struct nsdsel_gtls_s nsdsel_gtls_t; -#ifdef OS_SOLARIS - typedef void nsd_t; - typedef void nsdsel_t; -#else - typedef obj_t nsd_t; - typedef obj_t nsdsel_t; -#endif typedef struct msg msg_t; typedef struct prop_s prop_t; typedef struct interface_s interface_t; @@ -108,6 +97,21 @@ typedef rsRetVal (*prsf_t)(struct vmstk_s*, int); /* pointer to a RainerScript f 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; +#else + typedef obj_t obj_t_ptr; + typedef obj_t nsd_t; + typedef obj_t nsdsel_t; +#endif + + /* some universal 64 bit define... */ typedef long long int64; typedef long long unsigned uint64; -- cgit v1.2.3