From: Michihiro NAKAJIMA Date: Wed, 12 May 2010 08:41:03 +0000 (-0400) Subject: Avoid TRY_COMPILE() failure when detecting ARCHIVE_HASH_*_WIN. X-Git-Tag: v3.0.0a~1009 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=836aa1e577dd2f8437379944690f3f447f0d4d4a;p=thirdparty%2Flibarchive.git Avoid TRY_COMPILE() failure when detecting ARCHIVE_HASH_*_WIN. SVN-Revision: 2388 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c6329f7b..a6a897810 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,8 +284,21 @@ MACRO(CHECK_MD HASH IMPLEMENTATIONS) SET(SOURCE "#define ${hash}_COMPILE_TEST #define ARCHIVE_HASH_${hash}_${IMPLEMENTATION} #define __LIBARCHIVE_BUILD +#if defined(_WIN32) && !defined(__CYGWIN__) +#include +#endif #include \"archive_hash.h\" +#if defined(ARCHIVE_HASH_MD5_WIN) ||\\ + defined(ARCHIVE_HASH_SHA1_WIN) || defined(ARCHIVE_HASH_SHA256_WIN) ||\\ + defined(ARCHIVE_HASH_SHA384_WIN) || defined(ARCHIVE_HASH_SHA512_WIN) +/* avoid link error. in this case, we need to prove if CALG_*, which are + * used for a parameter algId, are defined. */ +void __la_hash_Init(Digest_CTX *ctx, ALG_ID algId){ ;} +void __la_hash_Update(Digest_CTX *ctx, const unsigned char *buf, size_t len) {;} +void __la_hash_Final(unsigned char *buf, size_t bufsize, Digest_CTX *ctx) {;} +#endif + int main(int argc, char **argv) {