include(GNUInstallDirs)
include(CheckLibraryExists)
include(CheckFunctionExists)
+include(CheckCSourceRuns)
enable_testing()
add_definitions(-DL_ENDIAN)
endif()
+check_c_source_runs("
+ #ifdef _MSC_VER
+ # include <intrin.h>
+ #else
+ # include <x86intrin.h>
+ #endif
+ int main(void) {
+ unsigned long long x = -1, y = 1, r;
+ unsigned char cf;
+ cf = _addcarry_u64(1, (unsigned long)x, y, &r);
+ return !(cf == 1 && r == 1);
+ }
+ " ADDCARRY_U64)
+if (ADDCARRY_U64)
+ add_definitions(-DHAVE_ADDCARRY_U64)
+endif()
+
set(BIN_DIRECTORY bin)
# Same soversion as OpenSSL
#include "gosthash2012.h"
#ifdef __x86_64__
-# include <immintrin.h>
-# include <x86intrin.h>
+# ifdef _MSC_VER
+# include <intrin.h>
+# else
+# include <x86intrin.h>
+# endif
#endif
#if defined(_WIN32) || defined(_WINDOWS)
unsigned int CF = 0;
unsigned int i;
-# ifdef __x86_64__
+# ifdef HAVE_ADDCARRY_U64
for (i = 0; i < 8; i++)
CF = _addcarry_u64(CF, x->QWORD[i] , y->QWORD[i], &(x->QWORD[i]));
# else