From: Fabian Keil Date: Thu, 28 May 2009 21:13:34 +0000 (+0000) Subject: Unbreak compilation for compilers that don't recognize lone defs. X-Git-Tag: v_3_0_13~62 X-Git-Url: http://www.privoxy.org/gitweb/introduction.html?a=commitdiff_plain;h=484c53d05cfe647a9a10981ba45e9579e33dcfe8;p=privoxy.git Unbreak compilation for compilers that don't recognize lone defs. Reported by Lee. --- diff --git a/cgi.c b/cgi.c index d0c224d4..9b0f4e3d 100644 --- a/cgi.c +++ b/cgi.c @@ -1,4 +1,4 @@ -const char cgi_rcs[] = "$Id: cgi.c,v 1.117 2009/05/16 13:27:20 fabiankeil Exp $"; +const char cgi_rcs[] = "$Id: cgi.c,v 1.118 2009/05/28 17:07:42 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.c,v $ @@ -1409,7 +1409,7 @@ void get_http_time(int time_offset, char *buf, size_t buffer_size) /* get and save the gmt */ #if HAVE_GMTIME_R t = gmtime_r(¤t_time, &dummy); -#elif def MUTEX_LOCKS_AVAILABLE +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&gmtime_mutex); t = gmtime(¤t_time); privoxy_mutex_unlock(&gmtime_mutex); @@ -1465,7 +1465,7 @@ static void get_locale_time(char *buf, size_t buffer_size) #if HAVE_LOCALTIME_R timeptr = localtime_r(¤t_time, &dummy); -#elif def MUTEX_LOCKS_AVAILABLE +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&localtime_mutex); timeptr = localtime(¤t_time); privoxy_mutex_unlock(&localtime_mutex); diff --git a/errlog.c b/errlog.c index ea3ad104..a6b47745 100644 --- a/errlog.c +++ b/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.94 2009/05/19 17:47:22 fabiankeil Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.95 2009/05/28 17:07:42 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -427,7 +427,7 @@ static inline size_t get_log_timestamp(char *buffer, size_t buffer_size) #ifdef HAVE_LOCALTIME_R tm_now = *localtime_r(&now, &tm_now); -#elif def MUTEX_LOCKS_AVAILABLE +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&localtime_mutex); tm_now = *localtime(&now); privoxy_mutex_unlock(&localtime_mutex); @@ -485,7 +485,7 @@ static inline size_t get_clf_timestamp(char *buffer, size_t buffer_size) time (&now); #ifdef HAVE_GMTIME_R gmt = *gmtime_r(&now, &gmt); -#elif def MUTEX_LOCKS_AVAILABLE +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&gmtime_mutex); gmt = *gmtime(&now); privoxy_mutex_unlock(&gmtime_mutex); @@ -494,7 +494,7 @@ static inline size_t get_clf_timestamp(char *buffer, size_t buffer_size) #endif #ifdef HAVE_LOCALTIME_R tm_now = localtime_r(&now, &dummy); -#elif def MUTEX_LOCKS_AVAILABLE +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&localtime_mutex); tm_now = localtime(&now); privoxy_mutex_unlock(&localtime_mutex); diff --git a/jbsockets.c b/jbsockets.c index 11337087..2a669ccd 100644 --- a/jbsockets.c +++ b/jbsockets.c @@ -1,4 +1,4 @@ -const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.59 2009/05/25 15:43:34 fabiankeil Exp $"; +const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.60 2009/05/28 17:07:42 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $ @@ -945,7 +945,7 @@ void get_host_information(jb_socket afd, char **ip_address, char **hostname) { host = NULL; } -#elif def MUTEX_LOCKS_AVAILABLE +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&resolver_mutex); host = gethostbyaddr((const char *)&server.sin_addr, sizeof(server.sin_addr), AF_INET); @@ -1111,7 +1111,7 @@ unsigned long resolve_hostname_to_ip(const char *host) { hostp = NULL; } -#elif def MUTEX_LOCKS_AVAILABLE +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&resolver_mutex); while (NULL == (hostp = gethostbyname(host)) && (h_errno == TRY_AGAIN) && (dns_retries++ < MAX_DNS_RETRIES)) diff --git a/parsers.c b/parsers.c index 0ee8ea7d..aca606e9 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.165 2009/05/28 17:07:42 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.166 2009/05/28 18:42:30 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -2280,7 +2280,7 @@ static jb_err server_last_modified(struct client_state *csp, char **header) now = time(NULL); #ifdef HAVE_GMTIME_R gmtime_r(&now, &gmt); -#elif def MUTEX_LOCKS_AVAILABLE +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&gmtime_mutex); gmtime(&now); privoxy_mutex_unlock(&gmtime_mutex); @@ -2310,7 +2310,7 @@ static jb_err server_last_modified(struct client_state *csp, char **header) last_modified += rtime; #ifdef HAVE_GMTIME_R timeptr = gmtime_r(&last_modified, &gmt); -#elif def MUTEX_LOCKS_AVAILABLE +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&gmtime_mutex); timeptr = gmtime(&last_modified); privoxy_mutex_unlock(&gmtime_mutex); @@ -3030,7 +3030,7 @@ static jb_err client_if_modified_since(struct client_state *csp, char **header) tm += rtime * (negative ? -1 : 1); #ifdef HAVE_GMTIME_R timeptr = gmtime_r(&tm, &gmt); -#elif def MUTEX_LOCKS_AVAILABLE +#elif defined(MUTEX_LOCKS_AVAILABLE) privoxy_mutex_lock(&gmtime_mutex); timeptr = gmtime(&tm); privoxy_mutex_unlock(&gmtime_mutex);