diff options
author | Fábio Machado de Oliveira <fabio.machado@linx.com.br> | 2021-08-19 11:25:49 -0300 |
---|---|---|
committer | Alan Antonuk <alan.antonuk@gmail.com> | 2021-08-23 05:44:02 -0700 |
commit | b07a3b59e9110b04f89ab9ed6becf8b792c6d6e6 (patch) | |
tree | 6738df309a46bae11cf1bdb4bdc223c326533ac5 | |
parent | 027a626d8c82e70557a33cfd64d3b41dc6faa094 (diff) | |
download | rabbitmq-c-b07a3b59e9110b04f89ab9ed6becf8b792c6d6e6.tar.gz |
lib: compatibility with old Borland compilers
-rw-r--r-- | include/rabbitmq-c/amqp.h | 2 | ||||
-rw-r--r-- | librabbitmq/amqp_private.h | 4 | ||||
-rw-r--r-- | librabbitmq/amqp_socket.c | 14 |
3 files changed, 14 insertions, 6 deletions
diff --git a/include/rabbitmq-c/amqp.h b/include/rabbitmq-c/amqp.h index 7575bad..02dddfa 100644 --- a/include/rabbitmq-c/amqp.h +++ b/include/rabbitmq-c/amqp.h @@ -40,7 +40,7 @@ #endif #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || (defined(__BORLANDC__) && (__BORLANDC__ <= 0x0564)) #ifdef _WIN64 typedef __int64 ssize_t; #else diff --git a/librabbitmq/amqp_private.h b/librabbitmq/amqp_private.h index ac848f8..3ecaa95 100644 --- a/librabbitmq/amqp_private.h +++ b/librabbitmq/amqp_private.h @@ -45,6 +45,10 @@ #define AMQP_UNUSED #endif +#if (defined(__BORLANDC__) && (__BORLANDC__ <= 0x0564)) +#define inline __inline +#endif + char *amqp_os_error_string(int err); #include "amqp_socket.h" diff --git a/librabbitmq/amqp_socket.c b/librabbitmq/amqp_socket.c index d14fc62..78ab63f 100644 --- a/librabbitmq/amqp_socket.c +++ b/librabbitmq/amqp_socket.c @@ -689,10 +689,11 @@ start_recv: int amqp_try_recv(amqp_connection_state_t state) { amqp_time_t timeout; + int res; while (amqp_data_in_buffer(state)) { amqp_frame_t frame; - int res = consume_one_frame(state, &frame); + res = consume_one_frame(state, &frame); if (AMQP_STATUS_OK != res) { return res; @@ -728,7 +729,7 @@ int amqp_try_recv(amqp_connection_state_t state) { state->last_queued_frame = link; } } - int res = amqp_time_s_from_now(&timeout, 0); + res = amqp_time_s_from_now(&timeout, 0); if (AMQP_STATUS_OK != res) { return res; } @@ -963,7 +964,9 @@ static int simple_wait_method_inner(amqp_connection_state_t state, amqp_method_number_t expected_method, amqp_time_t deadline, amqp_method_t *output) { - amqp_method_number_t expected_methods[] = {expected_method, 0}; + amqp_method_number_t expected_methods[2]; + expected_methods[0] = expected_method; + expected_methods[1] = 0; return amqp_simple_wait_method_list(state, expected_channel, expected_methods, deadline, output); } @@ -1432,7 +1435,8 @@ error_res: amqp_rpc_reply_t amqp_login(amqp_connection_state_t state, char const *vhost, int channel_max, int frame_max, int heartbeat, - int sasl_method, ...) { + amqp_sasl_method_enum sasl_method, ...) { + va_list vl; amqp_rpc_reply_t ret; @@ -1450,7 +1454,7 @@ amqp_rpc_reply_t amqp_login(amqp_connection_state_t state, char const *vhost, amqp_rpc_reply_t amqp_login_with_properties( amqp_connection_state_t state, char const *vhost, int channel_max, int frame_max, int heartbeat, const amqp_table_t *client_properties, - int sasl_method, ...) { + amqp_sasl_method_enum sasl_method, ...) { va_list vl; amqp_rpc_reply_t ret; |