Przeglądaj źródła

kazoo: fix deprecation warning

fixes #3466

From https://github.com/alanxz/rabbitmq-c/blob/c3e4176659aac7d0e497da90a46c08c63b98282a/include/rabbitmq-c/ssl_socket.h#L250
> * \deprecated Since v0.13.0 this is a no-op. OpenSSL automatically manages
> *    library initialization and uninitialization.

> Warning: kz_amqp.c:857:3: warning: 'amqp_set_initialize_ssl_library' is deprecated [-Wdeprecated-declarations]
>                 amqp_set_initialize_ssl_library(1);
>                 ^
> /usr/include/rabbitmq-c/ssl_socket.h:249:1: note: 'amqp_set_initialize_ssl_library' has been explicitly marked deprecated here
> AMQP_DEPRECATED_EXPORT
> ^
> /usr/include/rabbitmq-c/export.h:29:46: note: expanded from macro 'AMQP_DEPRECATED_EXPORT'
> #  define AMQP_DEPRECATED_EXPORT AMQP_EXPORT AMQP_DEPRECATED
>                                              ^
> /usr/include/rabbitmq-c/export.h:25:43: note: expanded from macro 'AMQP_DEPRECATED'
> #  define AMQP_DEPRECATED __attribute__ ((__deprecated__))
>                                           ^
> 1 warning generated.

(cherry picked from commit eeb17678d77548073a59b54c0a08ebdb48b25fa2)
Victor Seva 11 miesięcy temu
rodzic
commit
8db46badd4
1 zmienionych plików z 4 dodań i 4 usunięć
  1. 4 4
      src/modules/kazoo/kz_amqp.c

+ 4 - 4
src/modules/kazoo/kz_amqp.c

@@ -846,17 +846,17 @@ void kz_amqp_channel_close(kz_amqp_conn_ptr rmq, amqp_channel_t channel)
 	kz_amqp_error("closing channel",
 			amqp_channel_close(rmq->conn, channel, AMQP_REPLY_SUCCESS));
 }
-
+#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 13
 int kz_ssl_initialized = 0;
-
+#endif
 int kz_amqp_connection_open_ssl(kz_amqp_conn_ptr rmq)
 {
-
+#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 13
 	if(!kz_ssl_initialized) {
 		kz_ssl_initialized = 1;
 		amqp_set_initialize_ssl_library(1);
 	}
-
+#endif
 	if(!(rmq->conn = amqp_new_connection())) {
 		LM_ERR("Failed to create new AMQP connection\n");
 		goto error;