1 From 48829f87ebafbb9938d23a8f0bff4d11d770690e Mon Sep 17 00:00:00 2001
2 From: Patrick Steinhardt <ps@pks.im>
3 Date: Thu, 20 Feb 2020 17:37:32 +0100
4 Subject: [PATCH] Fix possible compiler error due to undefined _MSC_VER
6 In order to determine how to set up the ARGON2_PUBLIC and ARGON2_LOCAL
7 macros, we check for various different environments via preprocessor
8 defines. For Microsoft Visual Studio, we check that the macro _MSC_VER
9 evaluates to non-zero via `#elif _MSC_VER`. This may raise a compile
10 error when compiling with "-Werror=undef" if the variable isn't defined.
12 Fix the issue by using `#elif defined(_MSC_VER)` instead.
14 include/argon2.h | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
17 diff --git a/include/argon2.h b/include/argon2.h
18 index fc8682c..1b471f6 100644
19 --- a/include/argon2.h
20 +++ b/include/argon2.h
21 @@ -30,7 +30,7 @@ extern "C" {
23 #define ARGON2_PUBLIC __attribute__((visibility("default")))
24 #define ARGON2_LOCAL __attribute__ ((visibility ("hidden")))
26 +#elif defined(_MSC_VER)
27 #define ARGON2_PUBLIC __declspec(dllexport)