From 49cefffbb767d21abc797a1460ef783d7fc21508 Mon Sep 17 00:00:00 2001 From: Roman Haefeli Date: Wed, 8 Mar 2017 09:47:22 +0100 Subject: [PATCH] make fixes by mrpeach work also when compiling with mingw --- comport.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/comport.c b/comport.c index 089cac8..2369a09 100644 --- a/comport.c +++ b/comport.c @@ -1323,7 +1323,8 @@ allows COM port numbers to be specified. */ /* Open the Comport for RD and WR and get a handle */ /* this line should use a real serial device */ -#ifdef _MSC_VER +//#ifdef _MSC_VER +#ifdef _WIN32 strncpy_s(test.serial_device_prefix, strlen(serial_device_prefix) + 1, serial_device_prefix, strlen(serial_device_prefix) + 1); #else strncpy(test.serial_device_prefix, serial_device_prefix, strlen(serial_device_prefix) + 1); @@ -1345,7 +1346,8 @@ allows COM port numbers to be specified. */ x = (t_comport *)pd_new(comport_class); x->comport = test.comport;/* com_num */ -#ifdef _MSC_VER +//#ifdef _MSC_VER +#ifdef _WIN32 strncpy_s(x->serial_device_prefix, strlen(serial_device_prefix) + 1, serial_device_prefix, strlen(serial_device_prefix) + 1); #else strncpy(x->serial_device_prefix, serial_device_prefix, strlen(serial_device_prefix) + 1);