From b564794eddda79d54374144653c1f4e05ae08a64 Mon Sep 17 00:00:00 2001 From: Andrzej Fiedukowicz Date: Wed, 17 Jan 2024 15:06:11 +0100 Subject: [PATCH] Move includes in crypto_onetimeauth_poly1305.h outside of extern C (#1345) Includes being outside of `extern "C"` are de-facto standard in all other include files of libsodium. At the same time, having inside the `extern "C"` is causing problem with C++ vs. C toolchain being confused about which libraries should be linked. This was especially painful while working on `swift-sodium` integration with windows. --- .../include/sodium/crypto_onetimeauth_poly1305.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h b/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h index f3e34d86..1565d37a 100644 --- a/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h +++ b/src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h @@ -1,13 +1,6 @@ #ifndef crypto_onetimeauth_poly1305_H #define crypto_onetimeauth_poly1305_H -#ifdef __cplusplus -# ifdef __GNUC__ -# pragma GCC diagnostic ignored "-Wlong-long" -# endif -extern "C" { -#endif - #include #include #include @@ -16,6 +9,13 @@ extern "C" { #include "export.h" +#ifdef __cplusplus +# ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wlong-long" +# endif +extern "C" { +#endif + typedef struct CRYPTO_ALIGN(16) crypto_onetimeauth_poly1305_state { unsigned char opaque[256]; } crypto_onetimeauth_poly1305_state;