Skip to content

Commit

Permalink
always use the pure C++ code implementation of uint320 for msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdcvlsc committed May 28, 2024
1 parent 7be60b9 commit 695c41c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CC := g++
CXX := g++
TESTFLAGS := -g -Og -D_HIDE_WARNING
CXXFLAGS := -std=c++11 -Wall -Wextra

Expand Down Expand Up @@ -62,9 +62,9 @@ header_test: $(OBJ)
# -------------------------- test program compilation ---------------------------

$(SRC)/%.out: $(SRC)/%.cpp
# @echo "compiling test program - compiler : $(CC)"
# @echo "compiling test program - compiler : $(CXX)"
# @echo "flags: $<"
$(CC) $(TESTFLAGS) $(CXXFLAGS) -o $@ $<
$(CXX) $(TESTFLAGS) $(CXXFLAGS) -o $@ $<

clean:
ifeq ($(OS), Linux)
Expand Down
6 changes: 6 additions & 0 deletions uint320.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ bool uint320::operator>=(const uint320& with) const {
uint320& uint320::operator+=(const uint320& add) {

#if(__x86_64 || __x86_64__ || __amd64 || __amd64__ || __aarch64__ || _WIN64)

#if(_MSC_VER)
// assign 1 here since msvc does not accept just definition unlike clang and gcc
#define _PURE_CPP 1
#endif

#if(_MSC_VER || _PURE_CPP)
__uint128_t sum_uint128[UINT320LIMBS+1] = {0,0,0,0,0,0};

Expand Down

0 comments on commit 695c41c

Please sign in to comment.