diff -urN base-3.14.9.org/config/CONFIG.Host.alpha base-3.14.9/config/CONFIG.Host.alpha --- base-3.14.9.org/config/CONFIG.Host.alpha 2002-07-13 06:32:20.000000000 +0900 +++ base-3.14.9/config/CONFIG.Host.alpha 2007-01-21 20:43:34.000000000 +0900 @@ -12,7 +12,7 @@ # This file is maintained by the EPICS community. # Sites may override these definitions in CONFIG_SITE.Host.alpha -ARCH_CLASS = alpha +ARCH_CLASS = osf # Include definitions common to all Unix archs include $(EPICS_BASE)/config/CONFIG.Host.UnixCommon @@ -52,6 +52,6 @@ CCC_SHRLIB_LDFLAGS_YES = -shared CCC_DEPENDS_FLAG = -ARCH_DEP_CFLAGS = -D_OSF_SOURCE -ARCH_DEP_LDLIBS = +ARCH_DEP_CFLAGS = -D_OSF_SOURCE -pthread +ARCH_DEP_LDLIBS = -pthread diff -urN base-3.14.9.org/configure/os/CONFIG.Common.osf-alpha base-3.14.9/configure/os/CONFIG.Common.osf-alpha --- base-3.14.9.org/configure/os/CONFIG.Common.osf-alpha 2007-01-10 04:02:15.000000000 +0900 +++ base-3.14.9/configure/os/CONFIG.Common.osf-alpha 2007-02-10 19:21:31.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 diff -urN base-3.14.9.org/configure/os/CONFIG.Common.osf-alpha-gnu base-3.14.9/configure/os/CONFIG.Common.osf-alpha-gnu --- base-3.14.9.org/configure/os/CONFIG.Common.osf-alpha-gnu 2007-01-10 04:02:15.000000000 +0900 +++ base-3.14.9/configure/os/CONFIG.Common.osf-alpha-gnu 2007-02-11 04:44:48.000000000 +0900 @@ -21,6 +21,8 @@ OP_SYS_CPPFLAGS += -D_OSF_SOURCE OP_SYS_LDLIBS += -lrt +USR_SYS_LIBS += m + space:=$(empty) $(empty) colon := : diff -urN base-3.14.9.org/src/ca/comBuf.h base-3.14.9/src/ca/comBuf.h --- base-3.14.9.org/src/ca/comBuf.h 2006-12-01 07:19:03.000000000 +0900 +++ base-3.14.9/src/ca/comBuf.h 2006-12-17 13:23:02.000000000 +0900 @@ -82,6 +82,9 @@ unsigned push ( comBuf & ); template < class T > bool push ( const T & value ); +#ifdef __DECCXX /* cxx on osf-alpha */ + bool push ( const char * value ); +#endif /* __DECCXX */ template < class T > unsigned push ( const T * pValue, unsigned nElem ); unsigned push ( const epicsInt8 * pValue, unsigned nElem ); @@ -193,6 +196,20 @@ return true; } +#ifdef __DECCXX /* cxx on osf-alpha */ +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 ); diff -urN base-3.14.9.org/src/libCom/osi/os/osf/osdStdio.c base-3.14.9/src/libCom/osi/os/osf/osdStdio.c --- base-3.14.9.org/src/libCom/osi/os/osf/osdStdio.c 1970-01-01 09:00:00.000000000 +0900 +++ base-3.14.9/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; +}