Skip to content

Commit c34c651

Browse files
_MSC_VER support for C
1 parent 96126e5 commit c34c651

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nanomodbus.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ static nmbs_error handle_read_file_record(nmbs_t* nmbs) {
13191319
uint16_t record_number;
13201320
uint16_t record_length;
13211321
}
1322-
#ifdef __STDC_NO_VLA__
1322+
#if defined(__STDC_NO_VLA__) || defined(_MSC_VER)
13231323
subreq[35]; // 245 / subreq_header_size
13241324
#else
13251325
subreq[subreq_count];
@@ -1537,7 +1537,7 @@ static nmbs_error handle_read_write_registers(nmbs_t* nmbs) {
15371537
if (err != NMBS_ERROR_NONE)
15381538
return err;
15391539

1540-
#ifdef __STDC_NO_VLA__
1540+
#if defined(__STDC_NO_VLA__) || defined(_MSC_VER)
15411541
uint16_t registers[0x007B];
15421542
#else
15431543
uint16_t registers[byte_count_write / 2];
@@ -1580,7 +1580,7 @@ static nmbs_error handle_read_write_registers(nmbs_t* nmbs) {
15801580
}
15811581

15821582
if (!nmbs->msg.broadcast) {
1583-
#ifdef __STDC_NO_VLA__
1583+
#if defined(__STDC_NO_VLA__) || defined(_MSC_VER)
15841584
uint16_t regs[125];
15851585
#else
15861586
uint16_t regs[read_quantity];

0 commit comments

Comments
 (0)