Skip to content

Commit

Permalink
Move includes in crypto_onetimeauth_poly1305.h outside of extern C (j…
Browse files Browse the repository at this point in the history
…edisct1#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.
  • Loading branch information
fiedukow authored Jan 17, 2024
1 parent f62efca commit b564794
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/libsodium/include/sodium/crypto_onetimeauth_poly1305.h
Original file line number Diff line number Diff line change
@@ -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 <stdint.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -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;
Expand Down

0 comments on commit b564794

Please sign in to comment.