Skip to content

Commit 2b3ae25

Browse files
committed
rgw: Fix deprecated amqp includes
Since we have an obscenely wide supported version spread, we have to support the deprecated location, too. Signed-off-by: Adam Emerson <[email protected]>
1 parent 200c0af commit 2b3ae25

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

src/rgw/rgw_amqp.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
// vim: ts=8 sw=2 smarttab ft=cpp
33

44
#include "rgw_amqp.h"
5+
#if __has_include(<rabbitmq-c/amqp.h>)
6+
#include <rabbitmq-c/amqp.h>
7+
#include <rabbitmq-c/ssl_socket.h>
8+
#include <rabbitmq-c/tcp_socket.h>
9+
#include <rabbitmq-c/framing.h>
10+
#else
511
#include <amqp.h>
612
#include <amqp_ssl_socket.h>
713
#include <amqp_tcp_socket.h>
814
#include <amqp_framing.h>
15+
#endif // __has_include(<rabbitmq-c/amqp.h>)
916
#include "include/ceph_assert.h"
1017
#include <sstream>
1118
#include <cstring>

src/test/rgw/amqp_mock.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
// vim: ts=8 sw=2 smarttab
33

44
#include "amqp_mock.h"
5+
#if __has_include(<rabbitmq-c/amqp.h>)
6+
#include <rabbitmq-c/amqp.h>
7+
#include <rabbitmq-c/ssl_socket.h>
8+
#include <rabbitmq-c/tcp_socket.h>
9+
#else
510
#include <amqp.h>
611
#include <amqp_ssl_socket.h>
712
#include <amqp_tcp_socket.h>
13+
#endif
814
#include <string>
915
#include <stdarg.h>
1016
#include <mutex>

src/test/rgw/amqp_url.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040
#define _CRT_SECURE_NO_WARNINGS
4141
#endif
4242

43-
#include "amqp.h"
43+
#if __has_include(<rabbitmq-c/amqp.h>)
44+
#include <rabbitmq-c/amqp.h>
45+
#else
46+
#include <amqp.h>
47+
#endif
4448
#include <limits.h>
4549
#include <stdint.h>
4650
#include <stdio.h>

0 commit comments

Comments
 (0)