Skip to content

Commit 8654599

Browse files
committed
Conditional wolfcrypt-only wc_RNG_GenerateBlock for MSVC
1 parent 4c5bc5f commit 8654599

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wolfssl/wolfcrypt/random.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,12 @@ WOLFSSL_API int wc_FreeRng(WC_RNG* rng);
248248
/* some older compilers do not like macro function in expression */
249249
#define wc_RNG_GenerateBlock(rng, b, s) NOT_COMPILED_IN
250250
#else
251-
#define wc_RNG_GenerateBlock(rng, b, s) ({(void)rng; (void)b; (void)s; NOT_COMPILED_IN;})
251+
#ifdef _MSC_VER
252+
#define wc_RNG_GenerateBlock(rng, b, s) (int)(NOT_COMPILED_IN)
253+
#else
254+
#define wc_RNG_GenerateBlock(rng, b, s) \
255+
({(void)rng; (void)b; (void)s; NOT_COMPILED_IN;})
256+
#endif
252257
#endif
253258
#define wc_RNG_GenerateByte(rng, b) NOT_COMPILED_IN
254259
#define wc_FreeRng(rng) (void)NOT_COMPILED_IN

0 commit comments

Comments
 (0)