summaryrefslogtreecommitdiff
path: root/src/hmac256.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-01-21 21:36:43 +0000
committerWerner Koch <wk@gnupg.org>2010-01-21 21:36:43 +0000
commitb299da47a6f733c2e28fd98b8f2e19261f3b2608 (patch)
treedaf8da2d3dcbe142e03010fc9dc643b02c280a5b /src/hmac256.c
parentc9a727088a4a763ff368e4f10d98d3a0c3a8d3b2 (diff)
downloadlibgcrypt-b299da47a6f733c2e28fd98b8f2e19261f3b2608.tar.gz
Support WindowsCE.
Diffstat (limited to 'src/hmac256.c')
-rw-r--r--src/hmac256.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/hmac256.c b/src/hmac256.c
index b2f83dd0..a1383738 100644
--- a/src/hmac256.c
+++ b/src/hmac256.c
@@ -56,6 +56,15 @@
# include <fcntl.h> /* We need setmode(). */
#endif
+/* For a native WindowsCE binary we need to include gpg-error.h to
+ provide a replacement for strerror. In other cases we need a
+ replacement macro for gpg_err_set_errno. */
+#ifdef __MINGW32CE__
+# include <gpg-error.h>
+#else
+# define gpg_err_set_errno(a) (errno = (a))
+#endif
+
#include "hmac256.h"
@@ -502,7 +511,7 @@ _gcry_hmac256_file (void *result, size_t resultsize, const char *filename,
if (digestlen > resultsize)
{
_gcry_hmac256_release (hd);
- errno = EINVAL;
+ gpg_err_set_errno (EINVAL);
return -1;
}
memcpy (result, digest, digestlen);