Skip to content

Commit c457a04

Browse files
committed
clean up apr_time_from_msec() compatibility macros
* 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
1 parent 738272a commit c457a04

5 files changed

Lines changed: 14 additions & 23 deletions

File tree

modules/cluster/mod_heartmonitor.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,6 @@ static apr_status_t hm_recv(hm_ctx_t *ctx, apr_pool_t *p)
297297
return rv;
298298
}
299299

300-
301-
#ifndef apr_time_from_msec
302-
#define apr_time_from_msec(x) (x * 1000)
303-
#endif
304-
305-
306300
static apr_status_t hm_watchdog_callback(int state, void *data,
307301
apr_pool_t *pool)
308302
{

modules/proxy/mod_serf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "serf.h"
2727
#include "apr_uri.h"
2828
#include "apr_strings.h"
29+
#include "apr_version.h"
2930
#include "ap_mpm.h"
3031

3132
module AP_MODULE_DECLARE_DATA serf_module;
@@ -62,6 +63,9 @@ typedef struct {
6263
serf_bucket_t *body_bkt;
6364
} s_baton_t;
6465

66+
#if !APR_VERSION_AT_LEAST(1,4,0)
67+
#define apr_time_from_msec(x) (x * 1000)
68+
#endif
6569

6670
/**
6771
* 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,
393397
return APR_SUCCESS;
394398
}
395399

396-
#ifndef apr_time_from_msec
397-
#define apr_time_from_msec(x) (x * 1000)
398-
#endif
399-
400400
/* TOOD: rewrite drive_serf to make it async */
401401
static int drive_serf(request_rec *r, serf_config_t *conf)
402402
{

modules/test/mod_dialup.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@
3131

3232
module AP_MODULE_DECLARE_DATA dialup_module;
3333

34-
#ifndef apr_time_from_msec
35-
#define apr_time_from_msec(x) (x * 1000)
36-
#endif
37-
38-
3934
typedef struct dialup_dcfg_t {
4035
apr_size_t bytes_per_second;
4136
} dialup_dcfg_t;

server/mpm/event/event.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#include "apr_queue.h"
5858
#define APR_WANT_STRFUNC
5959
#include "apr_want.h"
60+
#include "apr_version.h"
6061

6162
#if APR_HAVE_UNISTD_H
6263
#include <unistd.h>
@@ -143,6 +144,10 @@
143144

144145
#define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
145146

147+
#if !APR_VERSION_AT_LEAST(1,4,0)
148+
#define apr_time_from_msec(x) (x * 1000)
149+
#endif
150+
146151
/*
147152
* Actual definitions of config globals
148153
*/
@@ -1031,10 +1036,6 @@ static apr_status_t event_register_timed_callback(apr_time_t t,
10311036
return APR_SUCCESS;
10321037
}
10331038

1034-
#ifndef apr_time_from_msec
1035-
#define apr_time_from_msec(x) (x * 1000)
1036-
#endif
1037-
10381039
static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
10391040
{
10401041
timer_event_t *ep;

server/mpm/simple/simple_run.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929

3030
#include "ap_listen.h"
3131
#include "mpm_common.h"
32+
#include "apr_version.h"
33+
34+
#if !APR_VERSION_AT_LEAST(1,4,0)
35+
#define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000)
36+
#endif
3237

3338
/**
3439
* Create Timers.
@@ -135,10 +140,6 @@ static void *simple_timer_invoke(apr_thread_t * thread, void *baton)
135140
return NULL;
136141
}
137142

138-
#ifndef apr_time_from_msec
139-
#define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000)
140-
#endif
141-
142143
static int simple_run_loop(simple_core_t * sc)
143144
{
144145
apr_status_t rv;

0 commit comments

Comments
 (0)