]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix deprecated amqp includes 62662/head
authorAdam Emerson <aemerson@redhat.com>
Wed, 27 Nov 2024 21:42:41 +0000 (16:42 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Thu, 3 Apr 2025 17:38:17 +0000 (13:38 -0400)
Since we have an obscenely wide supported version spread, we have to
support the deprecated location, too.

Signed-off-by: Adam Emerson <aemerson@redhat.com>
src/rgw/rgw_amqp.cc
src/test/rgw/amqp_mock.cc
src/test/rgw/amqp_url.c

index 06688fdacc917bc49d93394b438eefae122e3f03..2121ac134f53ba44ff66bc2d8b97b5f91af8dd9d 100644 (file)
@@ -2,10 +2,17 @@
 // vim: ts=8 sw=2 smarttab ft=cpp
 
 #include "rgw_amqp.h"
+#if __has_include(<rabbitmq-c/amqp.h>)
+#include <rabbitmq-c/amqp.h>
+#include <rabbitmq-c/ssl_socket.h>
+#include <rabbitmq-c/tcp_socket.h>
+#include <rabbitmq-c/framing.h>
+#else
 #include <amqp.h>
 #include <amqp_ssl_socket.h>
 #include <amqp_tcp_socket.h>
 #include <amqp_framing.h>
+#endif // __has_include(<rabbitmq-c/amqp.h>)
 #include "include/ceph_assert.h"
 #include <sstream>
 #include <cstring>
index 8674e5026f68ccfdaa61c77bcb2dc8c08899ed59..2795106f18d9a802347ec4bb3fabe5d352faa1ab 100644 (file)
@@ -2,9 +2,15 @@
 // vim: ts=8 sw=2 smarttab
 
 #include "amqp_mock.h"
+#if __has_include(<rabbitmq-c/amqp.h>)
+#include <rabbitmq-c/amqp.h>
+#include <rabbitmq-c/ssl_socket.h>
+#include <rabbitmq-c/tcp_socket.h>
+#else
 #include <amqp.h>
 #include <amqp_ssl_socket.h>
 #include <amqp_tcp_socket.h>
+#endif
 #include <string>
 #include <stdarg.h>
 #include <mutex>
index 520e95c69d87adf1d9223f99805519f2667187a5..48dab5cb5162c438e071eba9c9dbcd64918f4c19 100644 (file)
 #define _CRT_SECURE_NO_WARNINGS
 #endif
 
-#include "amqp.h"
+#if __has_include(<rabbitmq-c/amqp.h>)
+#include <rabbitmq-c/amqp.h>
+#else
+#include <amqp.h>
+#endif
 #include <limits.h>
 #include <stdint.h>
 #include <stdio.h>