From bdc57ecb2b4f908d9eb2126e3a48d8ac68a7264e Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 19 Nov 2014 13:16:56 -0600 Subject: [PATCH] Build issues for MinWG --- src/ioc/db/test/chfPluginTest.c | 3 ++- src/libCom/osi/os/WIN32/epicsAtomicOSD.h | 2 +- src/libCom/osi/os/WIN32/osdBackTrace.cpp | 17 +++++++++++------ src/libCom/osi/os/WIN32/osdStrtod.h | 6 ++++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/ioc/db/test/chfPluginTest.c b/src/ioc/db/test/chfPluginTest.c index 31958f575..ce32c4e43 100644 --- a/src/ioc/db/test/chfPluginTest.c +++ b/src/ioc/db/test/chfPluginTest.c @@ -12,6 +12,7 @@ */ #include +#include #include "chfPlugin.h" #include "dbStaticLib.h" @@ -540,7 +541,7 @@ MAIN(chfPluginTest) dbChannel *pch; db_field_log *pfl; -#ifdef WIN32 +#if defined(WIN32) && (!defined(_MINGW) || __MSVCRT_VERSION__ >= 0x0800) _set_output_format(_TWO_DIGIT_EXPONENT); #endif diff --git a/src/libCom/osi/os/WIN32/epicsAtomicOSD.h b/src/libCom/osi/os/WIN32/epicsAtomicOSD.h index ebd1124c7..da5e49c86 100644 --- a/src/libCom/osi/os/WIN32/epicsAtomicOSD.h +++ b/src/libCom/osi/os/WIN32/epicsAtomicOSD.h @@ -55,7 +55,7 @@ # define MS_InterlockedDecrement64 InterlockedDecrement64 # define MS_InterlockedExchange64 InterlockedExchange64 # define MS_InterlockedExchangeAdd64 InterlockedExchangeAdd64 -# define MS_InterlockedCompareExchange InterlockedCompareExchange64 +# define MS_InterlockedCompareExchange64 InterlockedCompareExchange64 #endif #include "epicsAtomicMS.h" diff --git a/src/libCom/osi/os/WIN32/osdBackTrace.cpp b/src/libCom/osi/os/WIN32/osdBackTrace.cpp index 9a33f6b11..8f5896a37 100644 --- a/src/libCom/osi/os/WIN32/osdBackTrace.cpp +++ b/src/libCom/osi/os/WIN32/osdBackTrace.cpp @@ -14,10 +14,15 @@ int epicsBackTrace(void **buf, int buf_sz) { - /* Docs say that (for some windows versions) the sum of - * skipped + captured frames must be less than 63 - */ - if ( buf_sz >= 63 ) - buf_sz = 62; - return CaptureStackBackTrace(0, buf_sz, buf, 0); +#ifdef CaptureStackBackTrace + /* Docs say that (for some windows versions) the sum of + * skipped + captured frames must be less than 63 + */ + if ( buf_sz >= 63 ) + buf_sz = 62; + return CaptureStackBackTrace(0, buf_sz, buf, 0); +#else + /* Older versions of MinGW */ + return -1; +#endif } diff --git a/src/libCom/osi/os/WIN32/osdStrtod.h b/src/libCom/osi/os/WIN32/osdStrtod.h index 83f448a35..d245df7dc 100644 --- a/src/libCom/osi/os/WIN32/osdStrtod.h +++ b/src/libCom/osi/os/WIN32/osdStrtod.h @@ -23,8 +23,10 @@ epicsShareFunc double epicsStrtod(const char *str, char **endp); * Older compilers have these equivalents though */ -#define strtoll _strtoi64 -#define strtoull _strtoui64 +#ifndef _MINGW +# define strtoll _strtoi64 +# define strtoull _strtoui64 +#endif #ifdef __cplusplus }