Skip to content

Commit e03357e

Browse files
Avoid redefinition warning for OPENSSL_API_COMPAT (#5646) (#5648)
Signed-off-by: Miguel Company <[email protected]> (cherry picked from commit e0c453b) Co-authored-by: Miguel Company <[email protected]>
1 parent 17b9017 commit e03357e

File tree

6 files changed

+22
-1
lines changed

6 files changed

+22
-1
lines changed

src/cpp/rtps/transport/TCPAcceptorSecure.h

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#ifndef _FASTDDS_TCP_ACCEPTOR_SECURE_
1616
#define _FASTDDS_TCP_ACCEPTOR_SECURE_
1717

18+
#ifdef OPENSSL_API_COMPAT
19+
#undef OPENSSL_API_COMPAT
20+
#endif // ifdef OPENSSL_API_COMPAT
1821
#define OPENSSL_API_COMPAT 10101
1922

2023
#include <asio/ssl.hpp>

src/cpp/rtps/transport/TCPChannelResourceSecure.h

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#ifndef _FASTDDS_TCP_CHANNEL_RESOURCE_SECURE_
1616
#define _FASTDDS_TCP_CHANNEL_RESOURCE_SECURE_
1717

18+
#ifdef OPENSSL_API_COMPAT
19+
#undef OPENSSL_API_COMPAT
20+
#endif // ifdef OPENSSL_API_COMPAT
1821
#define OPENSSL_API_COMPAT 10101
1922

2023
#include <asio.hpp>

src/cpp/rtps/transport/TCPTransportInterface.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
#ifndef _FASTDDS_TCP_TRANSPORT_INTERFACE_H_
1616
#define _FASTDDS_TCP_TRANSPORT_INTERFACE_H_
1717

18+
#if TLS_FOUND
19+
#ifdef OPENSSL_API_COMPAT
20+
#undef OPENSSL_API_COMPAT
21+
#endif // ifdef OPENSSL_API_COMPAT
22+
#define OPENSSL_API_COMPAT 10101
23+
#endif // if TLS_FOUND
24+
1825
#include <vector>
1926
#include <map>
2027
#include <memory>
@@ -35,7 +42,6 @@
3542
#include <rtps/transport/TCPChannelResourceBasic.h>
3643

3744
#if TLS_FOUND
38-
#define OPENSSL_API_COMPAT 10101
3945
#include <rtps/transport/TCPAcceptorSecure.h>
4046
#include <asio/ssl.hpp>
4147
#endif // if TLS_FOUND

src/cpp/security/artifact_providers/Pkcs11Provider.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
// TODO This isn't a proper fix for compatibility with OpenSSL 3.0, but
2020
// suppresses the warnings until true OpenSSL 3.0 APIs can be used.
21+
#ifdef OPENSSL_API_COMPAT
22+
#undef OPENSSL_API_COMPAT
23+
#endif // ifdef OPENSSL_API_COMPAT
2124
#define OPENSSL_API_COMPAT 10101
2225

2326
#include <security/artifact_providers/Pkcs11Provider.hpp>

src/cpp/security/authentication/PKIDH.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
// TODO This isn't a proper fix for compatibility with OpenSSL 3.0, but
2020
// suppresses the warnings until true OpenSSL 3.0 APIs can be used.
21+
#ifdef OPENSSL_API_COMPAT
22+
#undef OPENSSL_API_COMPAT
23+
#endif // ifdef OPENSSL_API_COMPAT
2124
#define OPENSSL_API_COMPAT 10101
2225

2326
#include <security/authentication/PKIDH.h>

test/unittest/security/authentication/BuiltinPKIDHTests.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
// TODO This isn't a proper fix for compatibility with OpenSSL 3.0, but
1616
// suppresses the warnings until true OpenSSL 3.0 APIs can be used.
17+
#ifdef OPENSSL_API_COMPAT
18+
#undef OPENSSL_API_COMPAT
19+
#endif // ifdef OPENSSL_API_COMPAT
1720
#define OPENSSL_API_COMPAT 10101
1821

1922
#include <iostream>

0 commit comments

Comments
 (0)