]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/amqp/test: fix mock prototype for librabbitmq-0.11.0 41418/head
authorYuval Lifshitz <ylifshit@redhat.com>
Sun, 11 Apr 2021 16:37:39 +0000 (19:37 +0300)
committerCory Snyder <csnyder@iland.com>
Wed, 19 May 2021 17:34:52 +0000 (13:34 -0400)
also use extern C for to get compilation errors when
function prototype change

Fixes: https://tracker.ceph.com/issues/50291
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
(cherry picked from commit 2ba598ec4c294bd09d2df18ccd2096382e303d39)

src/test/rgw/amqp_mock.cc

index e37151e48fc7264cb1c02bd5d2793e64c2b46a29..0d0c4a2719886f44c446dab589cc81635b1d9fc9 100644 (file)
@@ -98,6 +98,8 @@ struct amqp_socket_t_ {
   }
 };
 
+extern "C" {
+
 amqp_connection_state_t AMQP_CALL amqp_new_connection(void) {
   auto s = new amqp_connection_state_t_;
   return s;
@@ -256,7 +258,11 @@ amqp_confirm_select_ok_t* amqp_confirm_select(amqp_connection_state_t state, amq
   return state->confirm;
 }
 
+#if AMQP_VERSION >= AMQP_VERSION_CODE(0, 11, 0, 1)
+int amqp_simple_wait_frame_noblock(amqp_connection_state_t state, amqp_frame_t *decoded_frame, const struct timeval* tv) {
+#else
 int amqp_simple_wait_frame_noblock(amqp_connection_state_t state, amqp_frame_t *decoded_frame, struct timeval* tv) {
+#endif
   if (state->socket && state->socket->open_called &&
       state->login_called && state->channel1 && state->channel2 && state->exchange &&
       state->queue && state->consume && state->confirm && !FAIL_NEXT_READ) {
@@ -320,6 +326,8 @@ amqp_basic_consume_ok_t* amqp_basic_consume(
   return state->consume;
 }
 
+} // extern "C"
+
 // amqp_parse_url() is linked via the actual rabbitmq-c library code. see: amqp_url.c
 
 // following functions are the actual implementation copied from rabbitmq-c library
@@ -345,3 +353,4 @@ amqp_bytes_t amqp_bytes_malloc_dup(amqp_bytes_t src) {
   return result;
 }
 
+