From 947b90adb821ab2a8b8dc12b45e0829623423f9e Mon Sep 17 00:00:00 2001 From: IlyaGredasov Date: Tue, 28 Apr 2026 10:23:15 +0300 Subject: [PATCH] fix: add intrinsics to header for clang-msvc compilation --- include/slimcpplib/long_math_msvc.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/include/slimcpplib/long_math_msvc.h b/include/slimcpplib/long_math_msvc.h index a68615d..2172035 100644 --- a/include/slimcpplib/long_math_msvc.h +++ b/include/slimcpplib/long_math_msvc.h @@ -1,5 +1,4 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -// // Simple Long Integer Math for C++ // version 1.3 // @@ -31,12 +30,20 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// #pragma once - #include "long_math.h" #if defined(_MSC_VER) - -#include + #include + #include + + #if defined(__clang__) + extern "C" { + unsigned char _addcarry_u8(unsigned char, unsigned char, unsigned char, unsigned char*); + unsigned char _addcarry_u16(unsigned char, unsigned short, unsigned short, unsigned short*); + unsigned char _subborrow_u8(unsigned char, unsigned char, unsigned char, unsigned char*); + unsigned char _subborrow_u16(unsigned char, unsigned short, unsigned short, unsigned short*); + } + #endif namespace slim {