--- configure/os/CONFIG.Common.osf-alpha.org 2007-01-10 04:02:15.000000000 +0900 +++ configure/os/CONFIG.Common.osf-alpha 2008-09-30 20:56:39.000000000 +0900 @@ -16,7 +16,7 @@ CODE_CPPFLAGS = POSIX_CPPFLAGS += -pthread -ieee -POSIX_LDFLAGS += -pthread -ieee +POSIX_LDLIBS += -pthread -ieee OP_SYS_CPPFLAGS += -D_OSF_SOURCE OP_SYS_LDLIBS += -lrt --- src/ca/comBuf.h.org 2008-07-29 01:19:49.000000000 +0900 +++ src/ca/comBuf.h 2008-09-30 21:59:24.000000000 +0900 @@ -86,6 +86,9 @@ unsigned push ( comBuf & ); template < class T > bool push ( const T & value ); +#ifdef __DECCXX /* cxx on osf-alpha, I know it is dirty but ... */ + bool push ( const char * value ); +#endif /* __DECCXX */ template < class T > unsigned push ( const T * pValue, unsigned nElem ); unsigned push ( const epicsInt8 * pValue, unsigned nElem ); @@ -197,6 +200,20 @@ return true; } +#ifdef __DECCXX /* cxx on osf-alpha, I know it is dirty but ... */ +inline bool comBuf::push ( const char * value ) +{ + unsigned index = this->nextWriteIndex; + unsigned available = sizeof ( this->buf ) - index; + if ( sizeof ( value ) > available ) { + return false; + } + memcpy ( &this->buf[ index ], & value, sizeof ( value ) ); + this->nextWriteIndex = index + sizeof ( value ); + return true; +} +#endif /* __DECCXX */ + inline unsigned comBuf :: push ( const epicsInt8 *pValue, unsigned nElem ) { return copyInBytes ( pValue, nElem ); --- /dev/null 2008-10-02 21:32:44.000000000 +0900 +++ src/libCom/osi/os/osf/osdStdio.c 2006-12-23 08:50:52.000000000 +0900 @@ -0,0 +1,54 @@ +/*************************************************************************\ +* Copyright (c) 2002 The University of Chicago, as Operator of Argonne +* National Laboratory. +* Copyright (c) 2002 The Regents of the University of California, as +* Operator of Los Alamos National Laboratory. +* EPICS BASE Versions 3.13.7 +* and higher are distributed subject to a Software License Agreement found +* in file LICENSE that is included with this distribution. +\*************************************************************************/ + +#include +#define epicsExportSharedSymbols +#include +#include + +epicsShareFunc int epicsShareAPI epicsSnprintf( + char *str, size_t size, const char *format, ...) +{ + int nchars; + va_list pvar; + + va_start(pvar,format); + nchars = epicsVsnprintf(str,size,format,pvar); + va_end (pvar); + return(nchars); +} + +epicsShareFunc int epicsShareAPI epicsVsnprintf( + char *str, size_t size, const char *format, va_list ap) +{ + int nchars; + + nchars = vsnprintf ( str, size, format, ap ); + if (nchars == size-1) { + /* this means the buffer was not long enough */ + /* we try to find a return value for epicsVsnprintf standard */ + int i, nchars2, size2 = size * 2; + char *str2; + + for (i=0; i<20; i++, size2=size2*2) { + str2 = malloc(size2); + if (str2 != NULL) { + nchars2 = vsnprintf ( str2, size2, format, ap ); + if (nchars2 != size2-1) { + free(str2); + nchars = nchars2; + break; + } + } + free(str2); + } + } + return nchars; +}