From 26502adcbd76cbb3886907f6673ba25be21a7856 Mon Sep 17 00:00:00 2001 From: m0gg Date: Thu, 14 Dec 2006 19:36:49 +0000 Subject: Linux compile fixes --- libcsoap/soap-addressing.c | 28 +++++++++++++++++++++++++++- libcsoap/soap-fault.c | 6 +++++- libcsoap/soap-transport.c | 6 +++++- libcsoap/soap-xmlsec.c | 6 +++++- 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/libcsoap/soap-addressing.c b/libcsoap/soap-addressing.c index 8cb11b8..ebe6e66 100644 --- a/libcsoap/soap-addressing.c +++ b/libcsoap/soap-addressing.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: soap-addressing.c,v 1.9 2006/11/29 11:04:24 m0gg Exp $ +* $Id: soap-addressing.c,v 1.10 2006/12/14 19:36:49 m0gg Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2006 Heiko Ronsdorf @@ -45,6 +45,10 @@ #include #endif +#ifdef HAVE_PTHREAD_H +#include +#endif + #ifdef HAVE_ERRNO_H #include #endif @@ -66,6 +70,7 @@ #include "soap-server.h" #include "soap-addressing.h" +#ifdef HAVE_UUID_CREATE static const xmlChar * _soap_addressing_uuid_error(uint32_t status) { @@ -117,6 +122,27 @@ _soap_addressing_generate_id(void) return ret; } +#else +static char * +_soap_addressing_generate_id(void) +{ + char *ret; + static long counter = 0; + static pthread_mutex_t counter_lock = PTHREAD_MUTEX_INITIALIZER; + + if (!(ret = (char *)malloc(128))) + { + log_error2("malloc failed (%s)", strerror(errno)); + return NULL; + } + + pthread_mutex_lock(&counter_lock); + sprintf("%s/%i", soap_server_get_name(), counter); + pthread_mutex_unlock(&counter_lock); + + return ret; +} +#endif static xmlNsPtr _soap_addressing_get_namespace(xmlNodePtr node) diff --git a/libcsoap/soap-fault.c b/libcsoap/soap-fault.c index 4d86d2b..3341f7a 100644 --- a/libcsoap/soap-fault.c +++ b/libcsoap/soap-fault.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: soap-fault.c,v 1.15 2006/11/25 15:06:57 m0gg Exp $ +* $Id: soap-fault.c,v 1.16 2006/12/14 19:36:49 m0gg Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -29,6 +29,10 @@ #include #endif +#ifdef HAVE_ERRNO_H +#include +#endif + #include #include diff --git a/libcsoap/soap-transport.c b/libcsoap/soap-transport.c index 1c5a7bd..765fa8f 100644 --- a/libcsoap/soap-transport.c +++ b/libcsoap/soap-transport.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: soap-transport.c,v 1.8 2006/12/06 11:27:21 m0gg Exp $ +* $Id: soap-transport.c,v 1.9 2006/12/14 19:36:49 m0gg Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2007 Heiko Ronsdorf @@ -33,6 +33,10 @@ #include #endif +#ifdef HAVE_ERRNO_H +#include +#endif + #ifdef HAVE_UNISTD_H #include #endif diff --git a/libcsoap/soap-xmlsec.c b/libcsoap/soap-xmlsec.c index e4cadfb..01e5ae0 100644 --- a/libcsoap/soap-xmlsec.c +++ b/libcsoap/soap-xmlsec.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: soap-xmlsec.c,v 1.7 2006/12/06 11:27:21 m0gg Exp $ +* $Id: soap-xmlsec.c,v 1.8 2006/12/14 19:36:49 m0gg Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -45,6 +45,10 @@ #include #endif +#ifdef HAVE_ERRNO_H +#include +#endif + #ifdef HAVE_FCNTL_H #include #endif -- cgit v1.1-32-gdbae