]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/amqp/test: fix mock prototype for librabbitmq-0.11.0 40800/head
authorYuval Lifshitz <ylifshit@redhat.com>
Sun, 11 Apr 2021 16:37:39 +0000 (19:37 +0300)
committerYuval Lifshitz <ylifshit@redhat.com>
Mon, 12 Apr 2021 06:11:05 +0000 (09:11 +0300)
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>
src/test/rgw/amqp_mock.cc

index 5f0b00e9f1e0f6264e3a04cc3e9297635a35f918..8674e5026f68ccfdaa61c77bcb2dc8c08899ed59 100644 (file)
@@ -104,6 +104,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;
@@ -291,7 +293,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) {
@@ -355,6 +361,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
@@ -380,3 +388,4 @@ amqp_bytes_t amqp_bytes_malloc_dup(amqp_bytes_t src) {
   return result;
 }
 
+