Skip to content

Commit 04c8504

Browse files
authored
Merge pull request #297 from libtom/msvc-fixes
Msvc fixes (appveyor works!)
2 parents 8e1704d + 6ce1bcb commit 04c8504

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

appveyor.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 1.0.{build}
2+
image:
3+
- Visual Studio 2017
4+
- Visual Studio 2015
5+
build_script:
6+
- cmd: >-
7+
if "Visual Studio 2017"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
8+
if "Visual Studio 2015"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64
9+
if "Visual Studio 2015"=="%APPVEYOR_BUILD_WORKER_IMAGE%" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
10+
nmake -f makefile.msvc all
11+
test.exe

bn_s_mp_rand_platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static mp_err s_read_win_csp(void *p, size_t n)
3737
CRYPT_VERIFYCONTEXT | CRYPT_MACHINE_KEYSET | CRYPT_NEWKEYSET)) {
3838
return MP_ERR;
3939
}
40-
hProc = h;
40+
hProv = h;
4141
}
4242
return CryptGenRandom(hProv, (DWORD)n, (BYTE *)p) == TRUE ? MP_OKAY : MP_ERR;
4343
}

makefile.msvc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,6 @@ bn_s_mp_invmod_slow.obj bn_s_mp_karatsuba_mul.obj bn_s_mp_karatsuba_sqr.obj bn_s
4747
bn_s_mp_mul_digs.obj bn_s_mp_mul_digs_fast.obj bn_s_mp_mul_high_digs.obj bn_s_mp_mul_high_digs_fast.obj \
4848
bn_s_mp_prime_is_divisible.obj bn_s_mp_rand_jenkins.obj bn_s_mp_rand_platform.obj bn_s_mp_reverse.obj \
4949
bn_s_mp_sqr.obj bn_s_mp_sqr_fast.obj bn_s_mp_sub.obj bn_s_mp_toom_mul.obj bn_s_mp_toom_sqr.obj
50-
bn_mp_set_double.obj bn_mp_set_int.obj bn_mp_set_long.obj bn_mp_set_long_long.obj bn_mp_shrink.obj \
51-
bn_mp_signed_bin_size.obj bn_mp_signed_rsh.obj bn_mp_sqr.obj bn_mp_sqrmod.obj bn_mp_sqrt.obj bn_mp_sqrtmod_prime.obj \
52-
bn_mp_sub.obj bn_mp_sub_d.obj bn_mp_submod.obj bn_mp_to_signed_bin.obj bn_mp_to_signed_bin_n.obj \
53-
bn_mp_to_unsigned_bin.obj bn_mp_to_unsigned_bin_n.obj bn_mp_toradix.obj bn_mp_toradix_n.obj \
54-
bn_mp_unsigned_bin_size.obj bn_mp_xor.obj bn_mp_zero.obj bn_prime_tab.obj bn_s_mp_add.obj bn_s_mp_balance_mul.obj \
55-
bn_s_mp_exptmod.obj bn_s_mp_exptmod_fast.obj bn_s_mp_get_bit.obj bn_s_mp_invmod_fast.obj bn_s_mp_invmod_slow.obj \
56-
bn_s_mp_karatsuba_mul.obj bn_s_mp_karatsuba_sqr.obj bn_s_mp_montgomery_reduce_fast.obj bn_s_mp_mul_digs.obj \
57-
bn_s_mp_mul_digs_fast.obj bn_s_mp_mul_high_digs.obj bn_s_mp_mul_high_digs_fast.obj bn_s_mp_rand_jenkins.obj \
58-
bn_s_mp_rand_platform.obj bn_s_mp_reverse.obj bn_s_mp_sqr.obj bn_s_mp_sqr_fast.obj bn_s_mp_sub.obj \
59-
bn_s_mp_toom_mul.obj bn_s_mp_toom_sqr.obj
6050

6151
HEADERS_PUB=tommath.h
6252
HEADERS=tommath_private.h tommath_class.h tommath_superclass.h $(HEADERS_PUB)

tommath.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ typedef struct {
229229

230230
/* callback for mp_prime_random, should fill dst with random bytes and return how many read [upto len] */
231231
typedef int private_mp_prime_callback(unsigned char *dst, int len, void *dat);
232-
typedef private_mp_prime_callback ltm_prime_callback MP_DEPRECATED(mp_rand_source);
232+
typedef private_mp_prime_callback MP_DEPRECATED(mp_rand_source) ltm_prime_callback;
233233

234234
/* error code to char* string */
235235
const char *mp_error_to_string(mp_err code) MP_WUR;

tommath_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ typedef private_mp_word mp_word;
148148
#define MP_MAX(x, y) (((x) > (y)) ? (x) : (y))
149149

150150
/* Static assertion */
151-
#define MP_STATIC_ASSERT(msg, cond) typedef char mp_static_assert_##msg[-(!(cond))];
151+
#define MP_STATIC_ASSERT(msg, cond) typedef char mp_static_assert_##msg[(cond) ? 1 : -1];
152152

153153
/* ---> Basic Manipulations <--- */
154154
#define MP_IS_ZERO(a) ((a)->used == 0)

0 commit comments

Comments
 (0)