]> granicus.if.org Git - apache/commitdiff
clean up apr_time_from_msec() compatibility macros
authorJeff Trawick <trawick@apache.org>
Wed, 1 Apr 2009 22:06:49 +0000 (22:06 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 1 Apr 2009 22:06:49 +0000 (22:06 +0000)
* where needed, base on APR_VERSION_AT_LEAST() so we remember what this is about
* where not, axe

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@761084 13f79535-47bb-0310-9956-ffa450edef68

modules/cluster/mod_heartmonitor.c
modules/proxy/mod_serf.c
modules/test/mod_dialup.c
server/mpm/event/event.c
server/mpm/simple/simple_run.c

index cf9f42852ac86a199be82cd10b25d9870e0be3d2..78b391ad39ba62eba49225ff1646429fb12f7a14 100644 (file)
@@ -297,12 +297,6 @@ static apr_status_t hm_recv(hm_ctx_t *ctx, apr_pool_t *p)
     return rv;
 }
 
-
-#ifndef apr_time_from_msec
-#define apr_time_from_msec(x) (x * 1000)
-#endif
-
-
 static apr_status_t hm_watchdog_callback(int state, void *data,
                                          apr_pool_t *pool)
 {
index 35c252f4af2930cab2f34bff1c8b8b94892f31f9..019b32ddab86da6e8cd37f872527d470d86f085b 100644 (file)
@@ -26,6 +26,7 @@
 #include "serf.h"
 #include "apr_uri.h"
 #include "apr_strings.h"
+#include "apr_version.h"
 #include "ap_mpm.h"
 
 module AP_MODULE_DECLARE_DATA serf_module;
@@ -62,6 +63,9 @@ typedef struct {
     serf_bucket_t *body_bkt;
 } s_baton_t;
 
+#if !APR_VERSION_AT_LEAST(1,4,0)
+#define apr_time_from_msec(x) (x * 1000)
+#endif
 
 /**
  * This works right now because all timers are invoked in the single listener
@@ -393,10 +397,6 @@ static apr_status_t setup_request(serf_request_t *request,
     return APR_SUCCESS;
 }
 
-#ifndef apr_time_from_msec
-#define apr_time_from_msec(x) (x * 1000)
-#endif
-
 /* TOOD: rewrite drive_serf to make it async */
 static int drive_serf(request_rec *r, serf_config_t *conf)
 {
index 85059e21b5e15d915fe722efd6904180f20078fb..a39b0024e4e18b59092d6022754aeadfc76a7c5c 100644 (file)
 
 module AP_MODULE_DECLARE_DATA dialup_module;
 
-#ifndef apr_time_from_msec
-#define apr_time_from_msec(x) (x * 1000)
-#endif
-
-
 typedef struct dialup_dcfg_t {
     apr_size_t bytes_per_second;
 } dialup_dcfg_t;
index 06f07a8cd6ff69efcbb794bed92ce6794d4cb65d..fac39c49b882c786f7787e4e7e041b8074cf43c5 100644 (file)
@@ -57,6 +57,7 @@
 #include "apr_queue.h"
 #define APR_WANT_STRFUNC
 #include "apr_want.h"
+#include "apr_version.h"
 
 #if APR_HAVE_UNISTD_H
 #include <unistd.h>
 
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
 
+#if !APR_VERSION_AT_LEAST(1,4,0)
+#define apr_time_from_msec(x) (x * 1000)
+#endif
+
 /*
  * Actual definitions of config globals
  */
@@ -1031,10 +1036,6 @@ static apr_status_t event_register_timed_callback(apr_time_t t,
     return APR_SUCCESS;
 }
 
-#ifndef apr_time_from_msec
-#define apr_time_from_msec(x) (x * 1000)
-#endif
-
 static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
 {
     timer_event_t *ep;
index f8c34e901c356d3efd6d13eb6295c7308c5b0403..0004885273a759256efbc7024347cae857c535e8 100644 (file)
 
 #include "ap_listen.h"
 #include "mpm_common.h"
+#include "apr_version.h"
+
+#if !APR_VERSION_AT_LEAST(1,4,0)
+#define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000)
+#endif
 
 /**
  * Create Timers.
@@ -135,10 +140,6 @@ static void *simple_timer_invoke(apr_thread_t * thread, void *baton)
     return NULL;
 }
 
-#ifndef apr_time_from_msec
-#define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000)
-#endif
-
 static int simple_run_loop(simple_core_t * sc)
 {
     apr_status_t rv;