From 6ad770dc62f76fa0625d277b521a120b549d9fc2 Mon Sep 17 00:00:00 2001 From: zaq178miami Date: Sun, 23 Jun 2013 19:36:10 +0300 Subject: Add nonblocking connect support --- librabbitmq/amqp_timer.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'librabbitmq/amqp_timer.h') diff --git a/librabbitmq/amqp_timer.h b/librabbitmq/amqp_timer.h index d1718af..946096d 100644 --- a/librabbitmq/amqp_timer.h +++ b/librabbitmq/amqp_timer.h @@ -25,12 +25,37 @@ #include +#ifdef _WIN32 +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include +#else +# include +#endif + #define AMQP_NS_PER_S 1000000000 #define AMQP_NS_PER_US 1000 +#define AMQP_INIT_TIMER(structure) { \ + structure.current_timestamp = 0; \ + structure.timeout_timestamp = 0; \ +} + +typedef struct amqp_timer_t_ { + uint64_t current_timestamp; + uint64_t timeout_timestamp; + uint64_t ns_until_next_timeout; + struct timeval tv; +} amqp_timer_t; + /* Gets a monotonic timestamp in ns */ uint64_t amqp_get_monotonic_timestamp(void); +/* Prepare timeout value and modify timer state based on timer state. */ +int +amqp_timer_update(amqp_timer_t *timer, struct timeval *timeout); + #endif /* AMQP_TIMER_H */ -- cgit v1.2.1 From c2ce2cb0f356a48c409a27bc228dc3ad7218e82f Mon Sep 17 00:00:00 2001 From: Alan Antonuk Date: Sun, 13 Apr 2014 13:52:02 -0700 Subject: Mingw: specify WINVER 0x0502 when unspecified. WINVER 0x0502 is WinXP SP2 --- librabbitmq/amqp_timer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'librabbitmq/amqp_timer.h') diff --git a/librabbitmq/amqp_timer.h b/librabbitmq/amqp_timer.h index 946096d..8ac3de9 100644 --- a/librabbitmq/amqp_timer.h +++ b/librabbitmq/amqp_timer.h @@ -26,6 +26,9 @@ #include #ifdef _WIN32 +# ifndef WINVER +# define WINVER 0x0502 +# endif # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif @@ -58,4 +61,3 @@ int amqp_timer_update(amqp_timer_t *timer, struct timeval *timeout); #endif /* AMQP_TIMER_H */ - -- cgit v1.2.1