Skip to content

Commit

Permalink
Attempt to fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
botovq authored and LDVG committed Mar 22, 2024
1 parent d147c4b commit 723788f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 9 additions & 3 deletions src/rs1.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@

#include "fido.h"

#if defined(__GNUC__)
#define PRAGMA(s) _Pragma(s)
#else
#define PRAGMA(s)
#endif

static EVP_MD *
rs1_get_EVP_MD(void)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual"
PRAGMA("GCC diagnostic push")
PRAGMA("GCC diagnostic ignored \"-Wcast-qual\"")
return ((EVP_MD *)EVP_sha1());
#pragma GCC diagnostic pop
PRAGMA("GCC diagnostic pop")
}

int
Expand Down
12 changes: 9 additions & 3 deletions src/rs256.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@
#define get0_RSA(x) EVP_PKEY_get0((x))
#endif

#if defined(__GNUC__)
#define PRAGMA(s) _Pragma(s)
#else
#define PRAGMA(s)
#endif

static EVP_MD *
rs256_get_EVP_MD(void)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual"
PRAGMA("GCC diagnostic push")
PRAGMA("GCC diagnostic ignored \"-Wcast-qual\"")
return ((EVP_MD *)EVP_sha256());
#pragma GCC diagnostic pop
PRAGMA("GCC diagnostic pop")
}

static int
Expand Down

0 comments on commit 723788f

Please sign in to comment.