1
0
mirror of https://github.com/wjwwood/serial.git synced 2026-01-22 11:44:53 +08:00

support for mingw (mxe.cc)

This commit is contained in:
dawid 2014-01-02 19:47:39 +01:00
parent b1f25e884a
commit 780f76c40d
3 changed files with 6 additions and 2 deletions

View File

@ -55,7 +55,7 @@ int run(int argc, char **argv)
// Argument 2 is the baudrate
unsigned long baud = 0;
#ifdef WIN32
#if defined(WIN32) && !defined(__MINGW32__)
sscanf_s(argv[2], "%lu", &baud);
#else
sscanf(argv[2], "%lu", &baud);

View File

@ -650,7 +650,7 @@ public:
explicit IOException (std::string file, int line, int errnum)
: file_(file), line_(line), errno_(errnum) {
std::stringstream ss;
#if defined(_WIN32)
#if defined(_WIN32) && !defined(__MINGW32__)
char error_str [1024];
strerror_s(error_str, 1024, errnum);
#else

View File

@ -3,6 +3,10 @@
# include <alloca.h>
#endif
#if defined (__MINGW32__)
# define alloca __builtin_alloca
#endif
#include "serial/serial.h"
#ifdef _WIN32