diff --git a/.ci/travis-build.sh b/.ci/travis-build.sh index 39eb0ea5f..c71bdd90e 100755 --- a/.ci/travis-build.sh +++ b/.ci/travis-build.sh @@ -68,7 +68,7 @@ EOF type qemu-system-i386 || echo "Missing qemu" fi -make -j2 $EXTRA +make -j2 RTEMS_QEMU_FIXUPS=YES CMD_CFLAGS="${CMD_CFLAGS}" CMD_CXXFLAGS="${CMD_CXXFLAGS}" CMD_LDFLAGS="${CMD_LDFLAGS}" if [ "$TEST" != "NO" ] then diff --git a/.ci/travis-prepare.sh b/.ci/travis-prepare.sh new file mode 100755 index 000000000..393bd80b6 --- /dev/null +++ b/.ci/travis-prepare.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -e -x + +die() { + echo "$1" >&2 + exit 1 +} + +if [ -f /etc/hosts ] +then + # The travis-ci "bionic" image throws us a curveball in /etc/hosts + # by including two entries for localhost. The first for 127.0.1.1 + # which causes epicsSockResolveTest to fail. + # cat /etc/hosts + # ... + # 127.0.1.1 localhost localhost ip4-loopback + # 127.0.0.1 localhost nettuno travis vagrant travis-job-.... + + sudo sed -i -e '/^127\.0\.1\.1/ s|localhost\s*||g' /etc/hosts + + echo "==== /etc/hosts" + cat /etc/hosts + echo "====" +fi diff --git a/.travis.yml b/.travis.yml index e7b1ed57a..ad0196790 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,54 @@ -sudo: false -dist: trusty language: c -compiler: - - gcc + +matrix: + include: + - sudo: false + dist: bionic + compiler: gcc + env: CMPLR=gcc + - sudo: false + dist: xenial + compiler: gcc + env: CMPLR=gcc + - sudo: false + dist: bionic + compiler: gcc + env: CMPLR=gcc CMD_CXXFLAGS=-std=c++11 + - sudo: false + dist: trusty + compiler: gcc + env: CMPLR=gcc STATIC=YES + - sudo: false + dist: bionic + compiler: gcc + env: CMPLR=clang + - sudo: false + dist: xenial + compiler: gcc + env: CMPLR=clang + - sudo: false + dist: trusty + compiler: gcc + env: CMPLR=clang STATIC=YES + - sudo: false + dist: trusty + compiler: gcc + env: WINE=32 TEST=NO STATIC=YES + - sudo: false + dist: trusty + compiler: gcc + env: WINE=32 TEST=NO STATIC=NO + - sudo: false + dist: trusty + compiler: gcc + env: RTEMS=4.10 + - sudo: false + dist: trusty + compiler: gcc + env: RTEMS=4.9 + - os: osx + env: CMD_CFLAGS="-mmacosx-version-min=10.7" CMD_CXXFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++" CMD_LDXFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++" + addons: apt: packages: @@ -13,15 +59,5 @@ addons: - g++-mingw-w64-i686 - qemu-system-x86 script: + - .ci/travis-prepare.sh - .ci/travis-build.sh -env: - - CMPLR=gcc EXTRA=LINKER_USE_RPATH=ORIGIN - - CMPLR=clang - - CMPLR=gcc STATIC=YES - - CMPLR=clang STATIC=YES - - CMPLR=gcc EXTRA=CMD_CXXFLAGS=-std=c++11 - - CMPLR=clang EXTRA=CMD_CXXFLAGS=-std=c++11 - - WINE=32 TEST=NO STATIC=YES - - WINE=32 TEST=NO STATIC=NO - - RTEMS=4.10 TEST=YES - - RTEMS=4.9 TEST=YES diff --git a/modules/libcom/src/osi/os/posix/epicsMath.h b/modules/libcom/src/osi/os/posix/epicsMath.h index 4e558676c..a8e9b815f 100644 --- a/modules/libcom/src/osi/os/posix/epicsMath.h +++ b/modules/libcom/src/osi/os/posix/epicsMath.h @@ -14,6 +14,16 @@ #include #ifdef __cplusplus + +#if __cplusplus>=201103L +#include + +using std::isfinite; +using std::isinf; +using std::isnan; +using std::isnormal; +#endif + extern "C" { #endif diff --git a/modules/libcom/test/epicsSockResolveTest.c b/modules/libcom/test/epicsSockResolveTest.c index 8131d9dbf..04b2973fa 100644 --- a/modules/libcom/test/epicsSockResolveTest.c +++ b/modules/libcom/test/epicsSockResolveTest.c @@ -75,8 +75,11 @@ MAIN(epicsSockResolveTest) testSkip(2, " aToIPAddr() failed"); } else { - testOk(addr.sin_addr.s_addr == htonl(okdata[i].IP), " IP correct"); - testOk(addr.sin_port == htons(okdata[i].port), " Port correct"); + testOk(addr.sin_addr.s_addr == htonl(okdata[i].IP), + " IP correct 0x%08x == 0x%08x", (unsigned)ntohl(addr.sin_addr.s_addr), + (unsigned)okdata[i].IP); + testOk(addr.sin_port == htons(okdata[i].port), " Port correct %u == %u", + ntohs(addr.sin_port), okdata[i].port); } }