mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
Merge pull request #55 from dawid-aurobit/mingw
support for mingw (mxe.cc)
This commit is contained in:
commit
15d37ac3aa
@ -55,7 +55,7 @@ int run(int argc, char **argv)
|
|||||||
|
|
||||||
// Argument 2 is the baudrate
|
// Argument 2 is the baudrate
|
||||||
unsigned long baud = 0;
|
unsigned long baud = 0;
|
||||||
#ifdef WIN32
|
#if defined(WIN32) && !defined(__MINGW32__)
|
||||||
sscanf_s(argv[2], "%lu", &baud);
|
sscanf_s(argv[2], "%lu", &baud);
|
||||||
#else
|
#else
|
||||||
sscanf(argv[2], "%lu", &baud);
|
sscanf(argv[2], "%lu", &baud);
|
||||||
|
|||||||
@ -650,7 +650,7 @@ public:
|
|||||||
explicit IOException (std::string file, int line, int errnum)
|
explicit IOException (std::string file, int line, int errnum)
|
||||||
: file_(file), line_(line), errno_(errnum) {
|
: file_(file), line_(line), errno_(errnum) {
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32) && !defined(__MINGW32__)
|
||||||
char error_str [1024];
|
char error_str [1024];
|
||||||
strerror_s(error_str, 1024, errnum);
|
strerror_s(error_str, 1024, errnum);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -3,6 +3,10 @@
|
|||||||
# include <alloca.h>
|
# include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined (__MINGW32__)
|
||||||
|
# define alloca __builtin_alloca
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "serial/serial.h"
|
#include "serial/serial.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user