Allow contrib/Netxx to be manually built/installed in linux and be picked up by Cmake

This commit is contained in:
Scott Godin
2025-01-15 16:04:38 -05:00
parent ee7aa13b1b
commit f3099424fc
4 changed files with 9 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ PKG_CHECK_MODULES(PC_NETXX QUIET libnetxx-dev) # NetXX doesn't include a .pc fi
SET(NETXX_DEFINITIONS ${PC_NETXX_CFLAGS_OTHER})
FIND_PATH(NETXX_INCLUDE_DIR Netbuf.h
HINTS ${PC_NETXX_INCLUDEDIR} ${PC_NETXX_INCLUDE_DIRS} /usr/include/Netxx)
HINTS ${PC_NETXX_INCLUDEDIR} ${PC_NETXX_INCLUDE_DIRS} /usr/include/Netxx /usr/local/include/Netxx)
FIND_LIBRARY(NETXX_LIBRARY NAMES Netxx
HINTS ${PC_NETXX_LIBDIR} ${PC_NETXX_LIBRARY_DIRS})

View File

@@ -48,6 +48,7 @@
#include <iostream>
#include <exception>
#include <ctime>
#include <cstring>
namespace {
const Netxx::port_type const_port_echo = 4000;

View File

@@ -42,6 +42,7 @@
// standard includes
#include <streambuf>
#include <iostream>
#include <algorithm>
#include <cstring>
@@ -113,8 +114,8 @@ template<std::streamsize bufsize, class charT, class traits>
Netbuf<bufsize, charT, traits>::Netbuf (StreamBase &stream)
: stream_(stream)
{
setp(putbuf_, putbuf_ + bufsize);
setg(getbuf_+PUTBACK_SIZE, getbuf_+PUTBACK_SIZE, getbuf_+PUTBACK_SIZE);
this->setp(putbuf_, putbuf_ + bufsize);
this->setg(getbuf_+PUTBACK_SIZE, getbuf_+PUTBACK_SIZE, getbuf_+PUTBACK_SIZE);
}
//#############################################################################
template<std::streamsize bufsize, class charT, class traits>
@@ -127,7 +128,7 @@ typename Netbuf<bufsize, charT, traits>::int_type Netbuf<bufsize, charT, traits>
if (buffer_out() < 0) {
return traits::eof();
} else if (!traits::eq_int_type(c, traits::eof())) {
return sputc(c);
return this->sputc(c);
} else {
return traits::not_eof(c);
}

View File

@@ -252,10 +252,10 @@ inline bool Object::Member::operator == (const Member& member) const
element == member.element;
}
#if !_HAS_CXX17
class Object::Finder : public std::unary_function<Object::Member, bool>
#else
#if _HAS__CXX17 || __cplusplus >= 201703L
class Object::Finder
#else
class Object::Finder : public std::unary_function<Object::Member, bool>
#endif
{
public: