diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 711da3434..8c6cac578 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -197,7 +197,7 @@ endif $(TESTPRODNAME) $(PRODNAME): $(PRODUCT_OBJS) $(PROD_RESS) $(PROD_DEPLIBS) -$(TESTPRODNAME) $(PRODNAME):%$(EXE): +$(TESTPRODNAME) $(PRODNAME): %$(EXE): @$(RM) $@ $(DEBUGCMD) $(LINK.cpp) $(MT_EXE_COMMAND) @@ -218,15 +218,21 @@ $(TESTPRODNAME) $(PRODNAME):%$(EXE): @$(RM) $@ $(HDEPENDS.cpp) $< -%$(OBJ): %.c +# Cancel GNUMake's built-in rules, which don't have our _INC +# dependencies so could get used in some circumstances (gdd) +%.o : %.c +%.o : %.cc +%.o : %.cpp + +%$(OBJ): %.c $(COMMON_INC) $(INSTALL_INC) @$(RM) $@ $(COMPILE.c) -c $< -%$(OBJ): %.cc +%$(OBJ): %.cc $(COMMON_INC) $(INSTALL_INC) @$(RM) $@ $(COMPILE.cpp) -c $< -%$(OBJ): %.cpp +%$(OBJ): %.cpp $(COMMON_INC) $(INSTALL_INC) @$(RM) $@ $(COMPILE.cpp) -c $< diff --git a/configure/os/CONFIG.Common.solaris-sparc b/configure/os/CONFIG.Common.solaris-sparc index 7e8788048..eff24fca5 100644 --- a/configure/os/CONFIG.Common.solaris-sparc +++ b/configure/os/CONFIG.Common.solaris-sparc @@ -20,12 +20,11 @@ COMPILER_LDFLAGS += -mt SOLARIS_VERSION = $(subst 5.,,$(shell uname -r)) -POSIX_CPPFLAGS += -D_POSIX_C_SOURCE=200112L $(POSIX_CPPFLAGS_$(SOLARIS_VERSION)) -POSIX_CPPFLAGS += -D_XOPEN_SOURCE=500 -POSIX_LDLIBS += -lposix4 -lpthread $(POSIX_LDLIBS_$(SOLARIS_VERSION)) +POSIX_CFLAGS = -xc99 -D_POSIX_C_SOURCE=200112L +POSIX_LDLIBS += -lposix4 -lpthread OP_SYS_CPPFLAGS += -DSOLARIS=$(SOLARIS_VERSION) $(COMPILER_CPPFLAGS) -OP_SYS_LDFLAGS += $(COMPILER_LDFLAGS) +OP_SYS_LDFLAGS += $(COMPILER_LDFLAGS) # Set runtime path for shared libraries SHRLIBDIR_RPATH_LDFLAGS_YES += $(SHRLIB_DEPLIB_DIRS:%=-R%) diff --git a/configure/os/CONFIG.Common.solaris-sparc-gnu b/configure/os/CONFIG.Common.solaris-sparc-gnu index e1b7e4b28..83427e995 100644 --- a/configure/os/CONFIG.Common.solaris-sparc-gnu +++ b/configure/os/CONFIG.Common.solaris-sparc-gnu @@ -9,13 +9,15 @@ # Include definitions common to all solaris-sparc target archs include $(CONFIG)/os/CONFIG.Common.solaris-sparc -# CONFIG.Common.solaris-sparc -COMPILER_CPPFLAGS = -D_REENTRANT +COMPILER_CPPFLAGS = -D_REENTRANT + +POSIX_CFLAGS = -std=gnu99 -D_POSIX_C_SOURCE=200112L STLPORT_LDLIBS_NO = OP_SYS_LDLIBS_8 = -ldl OP_SYS_LDLIBS_9 = -ldl OP_SYS_LDLIBS_10 = +OP_SYS_LDLIBS_11 = -lc diff --git a/configure/os/CONFIG.Common.solaris-x86 b/configure/os/CONFIG.Common.solaris-x86 index e3632a7bc..3c78b0631 100644 --- a/configure/os/CONFIG.Common.solaris-x86 +++ b/configure/os/CONFIG.Common.solaris-x86 @@ -20,9 +20,8 @@ COMPILER_LDFLAGS += -mt SOLARIS_VERSION = $(subst 5.,,$(shell uname -r)) -POSIX_CPPFLAGS += -D_POSIX_C_SOURCE=200112L $(POSIX_CPPFLAGS_$(SOLARIS_VERSION)) -POSIX_CPPFLAGS += -D_XOPEN_SOURCE=500 -POSIX_LDLIBS += -lposix4 -lpthread $(POSIX_LDLIBS_$(SOLARIS_VERSION)) +POSIX_CFLAGS = -xc99 -D_POSIX_C_SOURCE=200112L +POSIX_LDLIBS += -lposix4 -lpthread OP_SYS_CPPFLAGS += -DSOLARIS=$(SOLARIS_VERSION) $(COMPILER_CPPFLAGS) OP_SYS_LDFLAGS += $(COMPILER_LDFLAGS) @@ -53,6 +52,7 @@ OP_SYS_LDLIBS += -lsocket -lnsl OP_SYS_LDLIBS_8 += -ldl -lCrun -lc OP_SYS_LDLIBS_9 += -ldl -lCrun -lc OP_SYS_LDLIBS_10 += -lCrun -lc +OP_SYS_LDLIBS_11 += -lCrun -lc OP_SYS_LDLIBS += $(OP_SYS_LDLIBS_$(SOLARIS_VERSION)) OP_SYS_LDLIBS += $(STLPORT_LDLIBS_$(USE_STLPORT)) diff --git a/configure/os/CONFIG.Common.solaris-x86-gnu b/configure/os/CONFIG.Common.solaris-x86-gnu index ce4fae0ad..6f024289c 100644 --- a/configure/os/CONFIG.Common.solaris-x86-gnu +++ b/configure/os/CONFIG.Common.solaris-x86-gnu @@ -12,9 +12,12 @@ include $(CONFIG)/os/CONFIG.Common.solaris-x86 COMPILER_CPPFLAGS = -D_REENTRANT +POSIX_CFLAGS = -std=gnu99 -D_POSIX_C_SOURCE=200112L + STLPORT_LDLIBS_NO = OP_SYS_LDLIBS_8 = -ldl -lc OP_SYS_LDLIBS_9 = -ldl -lc OP_SYS_LDLIBS_10 = -lc +OP_SYS_LDLIBS_11 = -lc diff --git a/configure/os/CONFIG.Common.vxWorks-486 b/configure/os/CONFIG.Common.vxWorks-486 index a849735ce..b048a2be4 100644 --- a/configure/os/CONFIG.Common.vxWorks-486 +++ b/configure/os/CONFIG.Common.vxWorks-486 @@ -11,14 +11,13 @@ include $(CONFIG)/os/CONFIG.Common.vxWorksCommon # Vx GNU cross compiler suffix -CMPLR_SUFFIX = 386 +CMPLR_SUFFIX = pentium -ARCH_CLASS = pc486 +ARCH_CLASS = x86 -ARCH_DEP_CPPFLAGS = -DCPU=I80486 -D_X86_ -ARCH_DEP_CFLAGS = -m486 -ARCH_DEP_CXXFLAGS += -x 'c++' -ARCH_DEP_CFLAGS += -fno-defer-pop +ARCH_DEP_CPPFLAGS = -DCPU=I80486 -D_X86_ +ARCH_DEP_CFLAGS = -mtune=i486 -march=i486 +ARCH_DEP_CFLAGS += -fno-zero-initialized-in-bss -fno-defer-pop # Allow site overrides -include $(CONFIG)/os/CONFIG_SITE.Common.vxWorks-486 diff --git a/configure/os/CONFIG.Common.vxWorks-pentium b/configure/os/CONFIG.Common.vxWorks-pentium index 324682a97..abec33c6a 100644 --- a/configure/os/CONFIG.Common.vxWorks-pentium +++ b/configure/os/CONFIG.Common.vxWorks-pentium @@ -11,12 +11,14 @@ include $(CONFIG)/os/CONFIG.Common.vxWorksCommon # Vx GNU cross compiler suffix -CMPLR_SUFFIX = 386 - -ARCH_CLASS = pcPentium +CMPLR_SUFFIX = pentium -ARCH_DEP_CPPFLAGS = -DCPU=PENTIUM -D_X86_ -ARCH_DEP_CFLAGS = -mpentium -ARCH_DEP_CXXFLAGS += -x 'c++' -ARCH_DEP_CFLAGS += -fno-defer-pop +ARCH_CLASS = x86 + +ARCH_DEP_CPPFLAGS = -DCPU=PENTIUM -D_X86_ +ARCH_DEP_CFLAGS = -mtune=pentium -march=pentium +ARCH_DEP_CFLAGS += -fno-zero-initialized-in-bss -fno-defer-pop + +# Allow site overrides +-include $(CONFIG)/os/CONFIG_SITE.Common.vxWorks-pentium diff --git a/configure/os/CONFIG.solarisCommon.solarisCommon b/configure/os/CONFIG.solarisCommon.solarisCommon index ef9d0d59e..c864a34f0 100644 --- a/configure/os/CONFIG.solarisCommon.solarisCommon +++ b/configure/os/CONFIG.solarisCommon.solarisCommon @@ -12,6 +12,8 @@ CMPLR_CLASS = solStudio SPARCWORKS = /opt/SUNWspro GNU = NO +# SPARCWORKS path is set in a CONFIG_SITE file + CC = $(SPARCWORKS)/bin/cc CCC = $(SPARCWORKS)/bin/CC CPP = $(CC) -E -Qn diff --git a/configure/os/CONFIG_SITE.Common.solaris-sparc b/configure/os/CONFIG_SITE.Common.solaris-sparc index 95d9b42d2..851254203 100644 --- a/configure/os/CONFIG_SITE.Common.solaris-sparc +++ b/configure/os/CONFIG_SITE.Common.solaris-sparc @@ -5,11 +5,12 @@ # Site Specific definitions for solaris-sparc target # Only the local epics system manager should modify this file -# If readline is installed uncomment the following macro definition -# to include command-line editing and history support -# +# location of the Solaris Studio (was SunPro) compilers +SPARCWORKS = /opt/SUNWspro +#SPARCWORKS = /opt/solarisstudio12.3 -# Readline library provides command-line editing and history in IOC shell +# If readline is installed, uncomment the following macro definition +# to use it for command-line editing and history support #COMMANDLINE_LIBRARY = READLINE # Use stLport library instead of default Cstd library diff --git a/configure/os/CONFIG_SITE.Common.solaris-x86 b/configure/os/CONFIG_SITE.Common.solaris-x86 new file mode 100644 index 000000000..2a972d9cb --- /dev/null +++ b/configure/os/CONFIG_SITE.Common.solaris-x86 @@ -0,0 +1,11 @@ +# CONFIG_SITE.Common.solaris-x86 +# +# $Revision-Id$ +# +# Site Specific definitions for solaris-x86 targets +# Only the local epics system manager should modify this file + +# location of the Solaris Studio (was SunPro) compilers +SPARCWORKS = /opt/SUNWspro +#SPARCWORKS = /opt/solarisstudio12.3 + diff --git a/configure/os/CONFIG_SITE.Common.solaris-x86_64 b/configure/os/CONFIG_SITE.Common.solaris-x86_64 index 315b93597..ce173608d 100644 --- a/configure/os/CONFIG_SITE.Common.solaris-x86_64 +++ b/configure/os/CONFIG_SITE.Common.solaris-x86_64 @@ -5,7 +5,7 @@ # Site Specific definitions for solaris-x86_64 target # Only the local epics system manager should modify this file -# Include definitions common to all solaris-x86_64 target archs +# Include definitions common to all solaris-x86 target archs -include $(CONFIG)/os/CONFIG_SITE.Common.solaris-x86 COMMANDLINE_LIBRARY = EPICS diff --git a/configure/os/CONFIG_SITE.solaris-sparc.Common b/configure/os/CONFIG_SITE.solaris-sparc.Common index d78cdadda..a7398dbcf 100644 --- a/configure/os/CONFIG_SITE.solaris-sparc.Common +++ b/configure/os/CONFIG_SITE.solaris-sparc.Common @@ -4,7 +4,4 @@ # # Site specific override definitions for solaris-sparc host builds # Only the local epics system manager should modify this file - -#INSTALL_LOCATION = /home/phoebus/JBA/testBaseNew -#CROSS_COMPILER_TARGET_ARCHS += vxWorks-ppc604 vxWorks-ppc603 vxWorks-68040 diff --git a/src/ca/client/CAref.html b/src/ca/client/CAref.html index c198ed56a..bdfa33376 100644 --- a/src/ca/client/CAref.html +++ b/src/ca/client/CAref.html @@ -631,7 +631,7 @@ standard out for each CA client beacon anomaly detect event.

See also When a Client Does not See the Server's Beacon.

-

Configuring the Maximum Search +

Configuring the Maximum Search Period

The rate at which name resolution (search) requests are sent exponentially @@ -896,9 +896,9 @@ feature.

See also Routing Restrictions on vxWorks Systems.


-

Building an Application

+

Building an Application

-

Required Header (.h) Files

+

Required Header (.h) Files

An application that uses the CA client library functions described in this document will need to include the cadef.h header files as follows.

@@ -910,7 +910,7 @@ many other header files (operating system specific and otherwise), and therefore the application must also specify "<EPICS base>/include/os/<arch>" in its header file search path.

-

Required Libraries

+

Required Libraries

An application that uses the Channel Access Client Library functions described in this document will need to link with the EPICS CA Client Library @@ -956,7 +956,7 @@ and Windows systems.

The above libraries are located in "<EPICS base>/lib/<architechture>".

-

Compiler and System Specific Build +

Compiler and System Specific Build Options

If you do not use the EPICS build environment (layered make files) then it @@ -1641,7 +1641,7 @@ etc.

-

excas

+

excas

excas [options]

@@ -1933,7 +1933,7 @@ made to build a new circuit. This behavior could result in undesirable resource consumption resulting from periodic circuit setup and teardown overhead (thrashing) during periods of CPU / network / IP kernel buffer congestion.

-

Put Requests Just Prior to Process +

Put Requests Just Prior to Process Termination Appear to be Ignored

Short lived CA client applications that issue a CA put request and then @@ -2555,7 +2555,7 @@ questionable practice for the following reasons.

is the same behavior as on all other OS. -

Calling CA Functions from POSIX signal +

Calling CA Functions from POSIX signal handlers

As you might expect, it isnt safe to call the CA client library from a POSIX diff --git a/src/ca/client/getCallback.cpp b/src/ca/client/getCallback.cpp index 05e654e30..0fc050043 100644 --- a/src/ca/client/getCallback.cpp +++ b/src/ca/client/getCallback.cpp @@ -57,9 +57,9 @@ void getCallback::completion ( // fetch client context and destroy prior to releasing // the lock and calling cb in case they destroy channel there this->chan.getClientCtx().destroyGetCallback ( guard, *this ); - { + if ( pFuncTmp ) { epicsGuardRelease < epicsMutex > unguard ( guard ); - ( *pFuncTmp ) ( args ); + pFuncTmp ( args ); } } diff --git a/src/ca/client/oldChannelNotify.cpp b/src/ca/client/oldChannelNotify.cpp index d8c259040..5775bcc6b 100644 --- a/src/ca/client/oldChannelNotify.cpp +++ b/src/ca/client/oldChannelNotify.cpp @@ -343,6 +343,9 @@ int epicsShareAPI ca_array_get_callback ( chtype type, if ( type < 0 ) { return ECA_BADTYPE; } + if ( pfunc == NULL ) { + return ECA_BADFUNCPTR; + } unsigned tmpType = static_cast < unsigned > ( type ); epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () ); @@ -416,6 +419,9 @@ int epicsShareAPI ca_array_put_callback ( chtype type, arrayElementCount count, if ( type < 0 ) { return ECA_BADTYPE; } + if ( pfunc == NULL ) { + return ECA_BADFUNCPTR; + } epicsGuard < epicsMutex > guard ( pChan->cacCtx.mutexRef () ); pChan->eliminateExcessiveSendBacklog ( guard ); unsigned tmpType = static_cast < unsigned > ( type ); diff --git a/src/ca/client/perl/CA.pm b/src/ca/client/perl/CA.pm index 31f09f9fb..48297162c 100644 --- a/src/ca/client/perl/CA.pm +++ b/src/ca/client/perl/CA.pm @@ -638,7 +638,7 @@ not follow this pattern, but are still printable strings. =item [1] R3.14 Channel Access Reference Manual by Jeffrey O. Hill -L +L =back @@ -649,7 +649,7 @@ Andrew Johnson, Eanj@aps.anl.govE =head1 COPYRIGHT AND LICENSE -Copyright (C) 2008 UChicago Argonne LLC, as Operator of Argonne National +Copyright (C) 2008-2014 UChicago Argonne LLC, as Operator of Argonne National Laboratory. This software is distributed under the terms of the EPICS Open License. diff --git a/src/ca/client/putCallback.cpp b/src/ca/client/putCallback.cpp index ba17a654c..85fcaeb7f 100644 --- a/src/ca/client/putCallback.cpp +++ b/src/ca/client/putCallback.cpp @@ -57,9 +57,9 @@ void putCallback::completion ( epicsGuard < epicsMutex > & guard ) // fetch client context and destroy prior to releasing // the lock and calling cb in case they destroy channel there this->chan.getClientCtx().destroyPutCallback ( guard, *this ); - { + if ( pFuncTmp ) { epicsGuardRelease < epicsMutex > unguard ( guard ); - ( *pFuncTmp ) ( args ); + pFuncTmp ( args ); } } diff --git a/src/ca/legacy/gdd/Makefile b/src/ca/legacy/gdd/Makefile index 7276dfb72..8ad0a4abd 100644 --- a/src/ca/legacy/gdd/Makefile +++ b/src/ca/legacy/gdd/Makefile @@ -30,9 +30,11 @@ INC += dbMapper.h INC += gddAppTable.h INC += gddAppFuncTable.h INC += smartGDDPointer.h -INC += gddApps.h INC += gddEnumStringTable.h +# Can't put this in INC, it causes a circular build dependency +TARGETS += $(INSTALL_INCLUDE)/gddApps.h + HTMLS += gdd.html HTMLS += gddref.html HTMLS += gddref2.html diff --git a/src/libCom/RTEMS/rtems_config.c b/src/libCom/RTEMS/rtems_config.c index 70d3dd50f..ff5fb8128 100644 --- a/src/libCom/RTEMS/rtems_config.c +++ b/src/libCom/RTEMS/rtems_config.c @@ -63,7 +63,7 @@ rtems_task Init (rtems_task_argument argument); * appropriate conditionals to use. * The new general time support makes including the RTC driverr less important. */ -#if !defined(mpc604) && !defined(__mc68040__) && !defined(__mcf5200__) && !defined(mpc7455) && !defined(__arm__) /* don't have RTC code */ +#if !defined(mpc604) && !defined(__mc68040__) && !defined(__mcf5200__) && !defined(mpc7455) && !defined(__arm__) && !defined(__nios2__)/* don't have RTC code */ #define CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER #endif diff --git a/src/libCom/RTEMS/rtems_init.c b/src/libCom/RTEMS/rtems_init.c index 65bbe39c7..e89006b51 100644 --- a/src/libCom/RTEMS/rtems_init.c +++ b/src/libCom/RTEMS/rtems_init.c @@ -279,11 +279,45 @@ initialize_remote_filesystem(char **argv, int hasLocalFilesystem) LogFatal("\"%s\" is not a valid command pathname.\n", rtems_bsdnet_bootp_cmdline); cp = mustMalloc(l + 20, "NFS mount paths"); server_path = cp; + server_name = rtems_bsdnet_bootp_server_name; if (rtems_bsdnet_bootp_cmdline[0] == '/') { mount_point = server_path; strncpy(mount_point, rtems_bsdnet_bootp_cmdline, l); mount_point[l] = '\0'; argv[1] = rtems_bsdnet_bootp_cmdline; + /* + * Its probably common to embed the mount point in the server + * name so, when this is occurring, dont clobber the mount point + * by appending the first node from the command path. This allows + * the mount point to be a different path then the server's mount + * path. + * + * This allows for example a line similar to as follows the DHCP + * configuration file. + * + * server-name "159.233@192.168.0.123:/vol/vol0/bootRTEMS"; + */ + if ( server_name ) { + const size_t allocSize = strlen ( server_name ) + 2; + char * const pServerName = mustMalloc( allocSize, + "NFS mount paths"); + char * const pServerPath = mustMalloc ( allocSize, + "NFS mount paths"); + const int scanfStatus = sscanf ( + server_name, + "%[^:] : / %s", + pServerName, + pServerPath + 1u ); + if ( scanfStatus == 2 ) { + pServerPath[0u]= '/'; + server_name = pServerName; + server_path = pServerPath; + } + else { + free ( pServerName ); + free ( pServerPath ); + } + } } else { char *abspath = mustMalloc(strlen(rtems_bsdnet_bootp_cmdline)+2,"Absolute command path"); @@ -296,7 +330,6 @@ initialize_remote_filesystem(char **argv, int hasLocalFilesystem) strcat(abspath, rtems_bsdnet_bootp_cmdline); argv[1] = abspath; } - server_name = rtems_bsdnet_bootp_server_name; } nfsMount(server_name, server_path, mount_point); #endif diff --git a/src/libCom/osi/epicsThread.cpp b/src/libCom/osi/epicsThread.cpp index ed016f47e..60b017b30 100644 --- a/src/libCom/osi/epicsThread.cpp +++ b/src/libCom/osi/epicsThread.cpp @@ -38,7 +38,7 @@ void epicsThreadRunable::run () {} void epicsThreadRunable::show ( unsigned int ) const {} class epicsThread :: unableToCreateThread : - public exception { + public std :: exception { public: const char * what () const throw (); }; @@ -90,7 +90,7 @@ extern "C" void epicsThreadCallEntryPoint ( void * pPvt ) } catch ( const epicsThread::exitException & ) { } - catch ( std::exception & except ) { + catch ( std :: exception & except ) { if ( ! waitRelease ) { pThread->printLastChanceExceptionMessage ( typeid ( except ).name (), except.what () ); diff --git a/src/libCom/osi/os/default/osdNetIntf.c b/src/libCom/osi/os/default/osdNetIntf.c index 1b38ce7cf..ab36fdf10 100644 --- a/src/libCom/osi/os/default/osdNetIntf.c +++ b/src/libCom/osi/os/default/osdNetIntf.c @@ -281,39 +281,45 @@ epicsShareFunc osiSockAddr epicsShareAPI osiLocalAddr (SOCKET socket) for ( pifreq = ifconf.ifc_req; pifreq <= pIfreqListEnd; pifreq = pnextifreq ) { osiSockAddr addrCpy; + uint32_t current_ifreqsize; /* * find the next if req */ pnextifreq = ifreqNext ( pifreq ); - if ( pifreq->ifr_addr.sa_family != AF_INET ) { - ifDepenDebugPrintf ( ("osiLocalAddr(): interface %s was not AF_INET\n", pifreq->ifr_name) ); + /* determine ifreq size */ + current_ifreqsize = ifreqSize ( pifreq ); + /* copy current ifreq to aligned bufferspace (to start of pIfreqList buffer) */ + memmove(pIfreqList, pifreq, current_ifreqsize); + + if ( pIfreqList->ifr_addr.sa_family != AF_INET ) { + ifDepenDebugPrintf ( ("osiLocalAddr(): interface %s was not AF_INET\n", pIfreqList->ifr_name) ); continue; } - addrCpy.sa = pifreq->ifr_addr; + addrCpy.sa = pIfreqList->ifr_addr; - status = socket_ioctl ( socket, SIOCGIFFLAGS, pifreq ); + status = socket_ioctl ( socket, SIOCGIFFLAGS, pIfreqList ); if ( status < 0 ) { - errlogPrintf ( "osiLocalAddr(): net intf flags fetch for %s failed\n", pifreq->ifr_name ); + errlogPrintf ( "osiLocalAddr(): net intf flags fetch for %s failed\n", pIfreqList->ifr_name ); continue; } - if ( ! ( pifreq->ifr_flags & IFF_UP ) ) { - ifDepenDebugPrintf ( ("osiLocalAddr(): net intf %s was down\n", pifreq->ifr_name) ); + if ( ! ( pIfreqList->ifr_flags & IFF_UP ) ) { + ifDepenDebugPrintf ( ("osiLocalAddr(): net intf %s was down\n", pIfreqList->ifr_name) ); continue; } /* * dont use the loop back interface */ - if ( pifreq->ifr_flags & IFF_LOOPBACK ) { - ifDepenDebugPrintf ( ("osiLocalAddr(): ignoring loopback interface: %s\n", pifreq->ifr_name) ); + if ( pIfreqList->ifr_flags & IFF_LOOPBACK ) { + ifDepenDebugPrintf ( ("osiLocalAddr(): ignoring loopback interface: %s\n", pIfreqList->ifr_name) ); continue; } - ifDepenDebugPrintf ( ("osiLocalAddr(): net intf %s found\n", pifreq->ifr_name) ); + ifDepenDebugPrintf ( ("osiLocalAddr(): net intf %s found\n", pIfreqList->ifr_name) ); init = 1; addr = addrCpy; diff --git a/src/libCom/osi/os/solaris/epicsMath.h b/src/libCom/osi/os/solaris/epicsMath.h index 1cf60b5db..87d4986a7 100644 --- a/src/libCom/osi/os/solaris/epicsMath.h +++ b/src/libCom/osi/os/solaris/epicsMath.h @@ -17,6 +17,10 @@ /* same as (!isnan(x) && !finite(x)) */ #endif +#ifndef isnan +# define isnan(x) ((x) != (x)) +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/src/libCom/test/epicsCalcTest.cpp b/src/libCom/test/epicsCalcTest.cpp index 4d01666e8..694a62d58 100644 --- a/src/libCom/test/epicsCalcTest.cpp +++ b/src/libCom/test/epicsCalcTest.cpp @@ -311,7 +311,7 @@ MAIN(epicsCalcTest) testExpr(exp(1.)); testExpr(floor(1.5)); - testExpr(finite(0)); + testExpr(finite(0.)); testExpr(finite(Inf)); testExpr(finite(-Inf)); testExpr(finite(NaN)); @@ -325,11 +325,11 @@ MAIN(epicsCalcTest) testCalc("finite(0,1,-Inf)", 0); testCalc("finite(0,-Inf,2)", 0); testCalc("finite(-Inf,1,2)", 0); - testExpr(isinf(0)); + testExpr(isinf(0.)); testExpr(isinf(Inf)); testExpr(!!isinf(-Inf)); // Some GCCs return -1/0/+1 rather than 0/+1 testExpr(isinf(NaN)); - testExpr(isnan(0)); + testExpr(isnan(0.)); testExpr(isnan(Inf)); testExpr(isnan(-Inf)); testExpr(isnan(NaN)); diff --git a/src/std/dev/devAiSoft.c b/src/std/dev/devAiSoft.c index e3eade8a7..77ee6dbed 100644 --- a/src/std/dev/devAiSoft.c +++ b/src/std/dev/devAiSoft.c @@ -20,6 +20,7 @@ #include "alarm.h" #include "dbDefs.h" #include "dbAccess.h" +#include "epicsMath.h" #include "recGbl.h" #include "devSup.h" #include "aiRecord.h" @@ -78,7 +79,7 @@ static long read_ai(aiRecord *prec) if (!dbGetLink(&prec->inp, DBR_DOUBLE, &val, 0, 0)) { /* Apply smoothing algorithm */ - if (prec->smoo != 0.0 && prec->dpvt) + if (prec->smoo != 0.0 && prec->dpvt && finite(prec->val)) prec->val = val * (1.00 - prec->smoo) + (prec->val * prec->smoo); else prec->val = val; diff --git a/src/std/rec/aiRecord.c b/src/std/rec/aiRecord.c index b624fde87..fb1218b16 100644 --- a/src/std/rec/aiRecord.c +++ b/src/std/rec/aiRecord.c @@ -444,7 +444,7 @@ static void convert(aiRecord *prec) } /* apply smoothing algorithm */ - if (prec->smoo != 0.0){ + if (prec->smoo != 0.0 && finite(prec->val)){ if (prec->init) prec->val = val; /* initial condition */ prec->val = val * (1.00 - prec->smoo) + (prec->val * prec->smoo); }else{ diff --git a/src/template/base/top/exampleApp/Db/Makefile b/src/template/base/top/exampleApp/Db/Makefile index 3adbf09a5..667845ecc 100644 --- a/src/template/base/top/exampleApp/Db/Makefile +++ b/src/template/base/top/exampleApp/Db/Makefile @@ -1,25 +1,18 @@ TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- -# ADD MACRO DEFINITIONS AFTER THIS LINE +# ADD MACRO DEFINITIONS BELOW HERE -#---------------------------------------------------- -# Optimization of db files using dbst (DEFAULT: NO) -#DB_OPT = YES - -#---------------------------------------------------- -# Create and install (or just install) -# databases, templates, substitutions like this +# Install databases, templates & substitutions like this DB += dbExample1.db DB += dbExample2.db DB += dbSubExample.db DB += user.substitutions -#---------------------------------------------------- # If .db template is not named *.template add # _TEMPLATE = include $(TOP)/configure/RULES #---------------------------------------- -# ADD RULES AFTER THIS LINE +# ADD EXTRA GNUMAKE RULES BELOW HERE diff --git a/src/template/base/top/exampleApp/src/Makefile b/src/template/base/top/exampleApp/src/Makefile index 243cd926f..f3b262c77 100644 --- a/src/template/base/top/exampleApp/src/Makefile +++ b/src/template/base/top/exampleApp/src/Makefile @@ -2,38 +2,37 @@ TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- -# ADD MACRO DEFINITIONS AFTER THIS LINE - -#============================= -# Build the IOC support library - -LIBRARY_IOC += _APPNAME_Support +# ADD MACRO DEFINITIONS BELOW HERE # xxxRecord.h will be created from xxxRecord.dbd DBDINC += xxxRecord -# Install devXxxSoft.dbd into /dbd + +# Install xxxSupport.dbd into /dbd DBD += xxxSupport.dbd +# Build an IOC support library +LIBRARY_IOC += _APPNAME_Support + # Compile and add the code to the support library _APPNAME_Support_SRCS += xxxRecord.c _APPNAME_Support_SRCS += devXxxSoft.c # Link locally-provided code into the support library, # rather than directly into the IOC application. +# This is required for Windows DLL builds. _APPNAME_Support_SRCS += dbSubExample.c _APPNAME_Support_SRCS += _APPNAME_Hello.c _APPNAME_Support_SRCS += initTrace.c _APPNAME_Support_LIBS += $(EPICS_BASE_IOC_LIBS) -#============================= # Build the IOC application - PROD_IOC = _APPNAME_ + # _APPNAME_.dbd will be created and installed DBD += _APPNAME_.dbd -# _APPNAME_.dbd will be made up from these files: +# _APPNAME_.dbd will include these files: _APPNAME__DBD += base.dbd _APPNAME__DBD += xxxSupport.dbd _APPNAME__DBD += dbSubExample.dbd @@ -43,19 +42,18 @@ _APPNAME__DBD += initTrace.dbd # _APPNAME__registerRecordDeviceDriver.cpp derives from _APPNAME_.dbd _APPNAME__SRCS += _APPNAME__registerRecordDeviceDriver.cpp -# Build the main IOC entry point on workstation OSs. +# Build the main IOC entry point where needed _APPNAME__SRCS_DEFAULT += _APPNAME_Main.cpp _APPNAME__SRCS_vxWorks += -nil- # Add support from base/src/vxWorks if needed #_APPNAME__OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary -# Link in the code from the support library +# Link in the code from our support library _APPNAME__LIBS += _APPNAME_Support -# NOTE: To build SNL programs, SNCSEQ must be defined +# To build SNL programs, SNCSEQ must be defined # in the /configure/RELEASE file - ifneq ($(SNCSEQ),) # Build sncExample into _APPNAME_Support sncExample_SNCFLAGS += +r @@ -72,12 +70,10 @@ ifneq ($(SNCSEQ),) sncProgram_LIBS += $(EPICS_BASE_HOST_LIBS) endif -# Finally link to the EPICS Base libraries +# Finally link IOC to the EPICS Base libraries _APPNAME__LIBS += $(EPICS_BASE_IOC_LIBS) -#============================= - include $(TOP)/configure/RULES #---------------------------------------- -# ADD RULES AFTER THIS LINE +# ADD EXTRA GNUMAKE RULES BELOW HERE