Merge pull request #36 from anjohnson/master

Support for additional Windows targets
This commit is contained in:
dhickin
2016-04-11 10:06:54 +01:00
14 changed files with 66 additions and 46 deletions

View File

@@ -8,7 +8,7 @@
* @author mrk
*/
#ifdef _WIN32
#if defined(_WIN32) && !defined(NOMINMAX)
#define NOMINMAX
#endif

View File

@@ -8,7 +8,7 @@
* @author mrk
*/
#ifdef _WIN32
#if defined(_WIN32) && !defined(NOMINMAX)
#define NOMINMAX
#endif

View File

@@ -10,6 +10,7 @@
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <string>
#define epicsExportSharedSymbols
@@ -50,7 +51,7 @@ ExceptionMixin::show() const
out<<symbols[i]<<"\n";
}
free(symbols);
std::free(symbols);
}
#endif

View File

@@ -27,7 +27,7 @@ using std::string;
#endif
#if EPICS_VERSION_INT < VERSION_INT(3,15,0,1)
/* integer conversion primitives added to epicsStdlib.c in 3.15.0.1 */
/* These integer conversion primitives added to epicsStdlib.c in 3.15.0.1 */
#define S_stdlib_noConversion 1 /* No digits to convert */
#define S_stdlib_extraneous 2 /* Extraneous characters */
@@ -249,18 +249,16 @@ epicsParseFloat(const char *str, float *to, char **units)
}
#endif
// MS Visual Studio 2013 defines strtoll, etc.
#if defined(_WIN32)
# if (_MSC_VER >= 1800)
# define WIN_NEEDS_OLL_FUNC 0
# else
# define WIN_NEEDS_OLL_FUNC 1
# endif
// Sometimes we have to provide our own copy of strtoll()
#if defined(_WIN32) && !defined(_MINGW)
# define NEED_OLL_FUNCS (EPICS_VERSION_INT < VERSION_INT(3,15,0,1))
#elif defined(vxWorks) && !defined(_WRS_VXWORKS_MAJOR)
# define NEED_OLL_FUNCS 1
#else
# define WIN_NEEDS_OLL_FUNC 0
# define NEED_OLL_FUNCS 0
#endif
#if defined(NEED_LONGLONG) && (defined(__vxworks) || WIN_NEEDS_OLL_FUNC)
#if defined(NEED_LONGLONG) && NEED_OLL_FUNCS
static
long long strtoll(const char *ptr, char ** endp, int base)
{
@@ -308,8 +306,10 @@ noconvert:
return 0;
}
#if defined(__vxworks)
/* vxworks version of std::istringstream >>uint64_t is buggy, we use out own implementation */
#if defined(vxWorks)
/* The VxWorks version of std::istringstream >> uint64_t is buggy,
* provide our own implementation
*/
static
unsigned long long strtoull(const char *nptr, char **endptr, int base)
{
@@ -551,9 +551,10 @@ void parseToPOD(const string& in, float *out) {
void parseToPOD(const string& in, double *out) {
int err = epicsParseDouble(in.c_str(), out, NULL);
if(err) handleParseError(err);
#if defined(__vxworks)
/* vxWorks strtod returns [-]epicsINF when it should return ERANGE error
* if [-]epicsINF is returned and first char is a digit then translate this into ERANGE error
#if defined(vxWorks)
/* vxWorks strtod returns [-]epicsINF when it should return ERANGE error.
* If [-]epicsINF is returned and the first char is a digit we translate
* this into an ERANGE error
*/
else if (*out == epicsINF || *out == -epicsINF) {
const char* s = in.c_str();

View File

@@ -11,7 +11,8 @@
#define BYTEBUFFER_H
#include <string>
#include <string.h>
#include <cstring>
#include <cstdlib>
#ifdef epicsExportSharedSymbols
#define byteBufferepicsExportSharedSymbols
@@ -224,7 +225,7 @@ public:
* Must be one of EPICS_BYTE_ORDER,EPICS_ENDIAN_LITTLE,EPICS_ENDIAN_BIG.
*/
ByteBuffer(std::size_t size, int byteOrder = EPICS_BYTE_ORDER) :
_buffer((char*)malloc(size)), _size(size),
_buffer((char*)std::malloc(size)), _size(size),
_reverseEndianess(byteOrder != EPICS_BYTE_ORDER),
_reverseFloatEndianess(byteOrder != EPICS_FLOAT_WORD_ORDER),
_wrapped(false)
@@ -257,7 +258,7 @@ public:
*/
~ByteBuffer()
{
if (_buffer && !_wrapped) free(_buffer);
if (_buffer && !_wrapped) std::free(_buffer);
}
/**
* Set the byte order.

View File

@@ -34,19 +34,14 @@
#ifndef EPICSEXCEPTION_H_
#define EPICSEXCEPTION_H_
#ifdef _WIN32
#pragma warning( push )
#pragma warning(disable: 4275) // warning C4275: non dll-interface class used as base for dll-interface class (std::logic_error)
#if defined(_WIN32) && !defined(NOMINMAX)
#define NOMINMAX
#endif
#include <stdexcept>
#include <string>
#include <cstdio>
#include <stdio.h>
#include <stdlib.h>
#include <shareLib.h>
// Users may redefine this for a large size if desired
@@ -58,7 +53,7 @@
# include <execinfo.h>
# include <cxxabi.h>
# define EXCEPT_USE_BACKTRACE
#elif defined(_WIN32) && !defined(__MINGW__) && !defined(SKIP_DBGHELP)
#elif defined(_WIN32) && !defined(_MINGW) && !defined(SKIP_DBGHELP)
# define _WINSOCKAPI_
# include <windows.h>
# include <dbghelp.h>
@@ -67,6 +62,12 @@
# define EXCEPT_USE_NONE
#endif
#if defined(_WIN32) && !defined(_MINGW)
#pragma warning( push )
#pragma warning(disable: 4275) // non dll-interface class used as base for dll-interface class (std::logic_error)
#pragma warning(disable: 4251) // class std::string needs to have dll-interface to be used by clients
#endif
namespace epics { namespace pvData {
@@ -228,7 +229,7 @@ private:
mutable std::string base_msg;
};
#ifdef _WIN32
#if defined(_WIN32) && !defined(_MINGW)
#pragma warning( pop )
#endif

View File

@@ -26,7 +26,7 @@
// where should we look?
#if defined(__GNUC__) && __GNUC__>=4 && !defined(__vxworks)
#if defined(__GNUC__) && __GNUC__>=4 && !defined(vxWorks)
// GCC >=4.0.0
# define SHARED_FROM_TR1

View File

@@ -7,7 +7,7 @@
#ifndef SHAREDVECTOR_H
#define SHAREDVECTOR_H
#ifdef _WIN32
#if defined(_WIN32) && !defined(NOMINMAX)
#define NOMINMAX
#endif

View File

@@ -8,7 +8,7 @@
* @author mrk
*/
#ifdef _WIN32
#if defined(_WIN32) && !defined(NOMINMAX)
#define NOMINMAX
#endif

View File

@@ -10,7 +10,7 @@
#ifndef PVDATA_H
#define PVDATA_H
#ifdef _WIN32
#if defined(_WIN32) && !defined(NOMINMAX)
#define NOMINMAX
#endif
@@ -29,15 +29,15 @@
#include <shareLib.h>
#include <compilerDependencies.h>
#if defined(__vxworks) && !defined(_WRS_VXWORKS_MAJOR)
#if defined(vxWorks) && !defined(_WRS_VXWORKS_MAJOR)
typedef class std::ios std::ios_base;
#endif
#if defined(__GNUC__) && !(defined(__vxworks) && !defined(_WRS_VXWORKS_MAJOR))
#define USAGE_DEPRECATED __attribute__((deprecated))
#define USAGE_DEPRECATED EPICS_DEPRECATED
#if defined(__GNUC__) && !(defined(vxWorks) && !defined(_WRS_VXWORKS_MAJOR))
#define USAGE_ERROR(MSG) __attribute__((error(MSG)))
#else
#define USAGE_DEPRECATED
#define USAGE_ERROR(MSG) { throw std::runtime_error(MSG); }
#endif
@@ -436,6 +436,16 @@ private:
friend class PVDataCreate;
};
/**
* @brief Some explicit specializations exist (defined in PVScalar.cpp)
*/
template<>
std::ostream& PVScalarValue<int8>::dumpValue(std::ostream& o) const;
template<>
std::ostream& PVScalarValue<uint8>::dumpValue(std::ostream& o) const;
template<>
std::ostream& PVScalarValue<boolean>::dumpValue(std::ostream& o) const;
/**
* typedefs for the various possible scalar types.
*/

View File

@@ -15,15 +15,19 @@
#ifndef PVTYPE_H
#define PVTYPE_H
#ifdef _WIN32
#if defined(_WIN32) && !defined(NOMINMAX)
#define NOMINMAX
#endif
#if defined(_WIN32) && !defined(_MINGW)
#pragma warning( push )
#pragma warning(disable: 4251)
#endif
#include <string>
#include <vector>
#if defined(__vxworks) && \
#if defined(vxWorks) && \
(_WRS_VXWORKS_MAJOR+0 <= 6) && (_WRS_VXWORKS_MINOR+0 < 9)
typedef int intptr_t;
typedef unsigned int uintptr_t;
@@ -126,7 +130,9 @@ typedef std::vector<std::string>::iterator StringArray_iterator;
typedef std::vector<std::string>::const_iterator StringArray_const_iterator;
}}
#if defined(_WIN32) && !defined(_MINGW)
#pragma warning( pop )
#endif
#endif /* PVTYPE_H */

View File

@@ -6,7 +6,7 @@
*/
/* Author: Matej Sekoranja Date: 2010.10.18 */
#ifdef _WIN32
#if defined(_WIN32) && !defined(NOMINMAX)
#define NOMINMAX
#endif

View File

@@ -10,7 +10,7 @@
* Author: Miha Vitorovic
*/
#ifdef _WIN32
#if defined(_WIN32) && !defined(NOMINMAX)
#define NOMINMAX
#endif

View File

@@ -5,7 +5,7 @@
*/
/* Author: Michael Davidsaver */
#ifdef _WIN32
#if defined(_WIN32) && !defined(NOMINMAX)
#define NOMINMAX
#endif