diff options
Diffstat (limited to 'src/libtomcrypt')
-rw-r--r-- | src/libtomcrypt/src/headers/tomcrypt_cfg.h | 2 | ||||
-rw-r--r-- | src/libtomcrypt/src/misc/crypt_libc.c | 12 | ||||
-rw-r--r-- | src/libtomcrypt/src/pk/asn1/der_encode_set.c | 4 | ||||
-rw-r--r-- | src/libtomcrypt/src/pk/asn1/der_encode_setof.c | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/libtomcrypt/src/headers/tomcrypt_cfg.h b/src/libtomcrypt/src/headers/tomcrypt_cfg.h index 7feae6e..bec60b8 100644 --- a/src/libtomcrypt/src/headers/tomcrypt_cfg.h +++ b/src/libtomcrypt/src/headers/tomcrypt_cfg.h @@ -28,7 +28,7 @@ LTC_EXPORT void * LTC_CALL XREALLOC(void *p, size_t n); LTC_EXPORT void * LTC_CALL XCALLOC(size_t n, size_t s); LTC_EXPORT void LTC_CALL XFREE(void *p); -LTC_EXPORT void LTC_CALL XQSORT(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); +LTC_EXPORT void LTC_CALL XQSORT(void *base, size_t nmemb, size_t size, int(__cdecl *compar)(const void *, const void *)); /* change the clock function too */ diff --git a/src/libtomcrypt/src/misc/crypt_libc.c b/src/libtomcrypt/src/misc/crypt_libc.c index bcc89f4..09de4d5 100644 --- a/src/libtomcrypt/src/misc/crypt_libc.c +++ b/src/libtomcrypt/src/misc/crypt_libc.c @@ -12,32 +12,32 @@ #include <stdlib.h> #include "../headers/tomcrypt.h" -void * LibTomMalloc(size_t n) +LTC_EXPORT void * LTC_CALL LibTomMalloc(size_t n) { return malloc(n); } -void * LibTomCalloc(size_t n, size_t s) +LTC_EXPORT void * LTC_CALL LibTomCalloc(size_t n, size_t s) { return calloc(n, s); } -void * LibTomRealloc(void *p, size_t n) +LTC_EXPORT void * LTC_CALL LibTomRealloc(void *p, size_t n) { return realloc(p, n); } -void LibTomFree(void * p) +LTC_EXPORT void LTC_CALL LibTomFree(void * p) { free(p); } -clock_t LibTomClock(void) +LTC_EXPORT clock_t LTC_CALL LibTomClock(void) { return clock(); } -void LibTomQsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)) +LTC_EXPORT void LTC_CALL LibTomQsort(void *base, size_t nmemb, size_t size, int(__cdecl*compar)(const void *, const void *)) { qsort(base, nmemb, size, compar); } diff --git a/src/libtomcrypt/src/pk/asn1/der_encode_set.c b/src/libtomcrypt/src/pk/asn1/der_encode_set.c index 41f6587..a7250fb 100644 --- a/src/libtomcrypt/src/pk/asn1/der_encode_set.c +++ b/src/libtomcrypt/src/pk/asn1/der_encode_set.c @@ -40,7 +40,7 @@ static int ltc_to_asn1(int v) } -static int qsort_helper(const void *a, const void *b) +static int __cdecl qsort_helper1(const void *a, const void *b) { ltc_asn1_list *A = (ltc_asn1_list *)a, *B = (ltc_asn1_list *)b; int r; @@ -84,7 +84,7 @@ int der_encode_set(ltc_asn1_list *list, unsigned long inlen, } /* sort it by the "type" field */ - XQSORT(copy, inlen, sizeof(*copy), &qsort_helper); + XQSORT(copy, inlen, sizeof(*copy), &qsort_helper1); /* call der_encode_sequence_ex() */ err = der_encode_sequence_ex(copy, inlen, out, outlen, LTC_ASN1_SET); diff --git a/src/libtomcrypt/src/pk/asn1/der_encode_setof.c b/src/libtomcrypt/src/pk/asn1/der_encode_setof.c index b4e97b5..cd63285 100644 --- a/src/libtomcrypt/src/pk/asn1/der_encode_setof.c +++ b/src/libtomcrypt/src/pk/asn1/der_encode_setof.c @@ -22,7 +22,7 @@ struct edge { unsigned long size; }; -static int qsort_helper(const void *a, const void *b) +static int __cdecl qsort_helper2(const void *a, const void *b) { struct edge *A = (struct edge *)a, *B = (struct edge *)b; int r; @@ -133,7 +133,7 @@ int der_encode_setof(ltc_asn1_list *list, unsigned long inlen, } /* sort based on contents (using edges) */ - XQSORT(edges, inlen, sizeof(*edges), &qsort_helper); + XQSORT(edges, inlen, sizeof(*edges), &qsort_helper2); /* copy static header */ XMEMCPY(out, buf, hdrlen); |