You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

742 lines
18 KiB

From bbcf7fd0646d74b7f169b3aa4231d9150028ed0d Mon Sep 17 00:00:00 2001
From: Rob Peters <info@domoticz.com>
Date: Sun, 17 May 2020 11:46:37 +0200
Subject: [PATCH] Avoid deprecated bind placeholders in global namespace
---
hardware/ASyncSerial.cpp | 2 +-
hardware/ASyncTCP.cpp | 4 +++-
hardware/Comm5Serial.cpp | 2 ++
hardware/CurrentCostMeterSerial.cpp | 4 +++-
hardware/DavisLoggerSerial.cpp | 4 +++-
hardware/DenkoviUSBDevices.cpp | 2 ++
hardware/EnOceanESP2.cpp | 4 +++-
hardware/EnOceanESP3.cpp | 4 +++-
hardware/EvohomeRadio.cpp | 3 +++
hardware/EvohomeSerial.cpp | 2 ++
hardware/KMTronic433.cpp | 4 +++-
hardware/KMTronicBase.cpp | 2 +-
hardware/KMTronicSerial.cpp | 4 +++-
hardware/MQTT.cpp | 2 ++
hardware/Meteostick.cpp | 4 +++-
hardware/MySensorsBase.cpp | 2 +-
hardware/MySensorsSerial.cpp | 4 +++-
hardware/OTGWBase.cpp | 2 +-
hardware/OTGWSerial.cpp | 4 +++-
hardware/OpenWebNetUSB.cpp | 3 ++-
hardware/P1MeterSerial.cpp | 4 +++-
hardware/Pinger.cpp | 2 ++
hardware/RAVEn.cpp | 2 ++
hardware/RFLinkSerial.cpp | 2 ++
hardware/RFXComSerial.cpp | 4 +++-
hardware/RFXComTCP.cpp | 2 --
hardware/Rego6XXSerial.cpp | 4 +++-
hardware/S0MeterBase.cpp | 2 +-
hardware/S0MeterSerial.cpp | 4 +++-
hardware/TCPProxy/tcpproxy_server.cpp | 2 ++
hardware/TeleinfoSerial.cpp | 4 +++-
hardware/USBtin.cpp | 4 +++-
hardware/XiaomiGateway.cpp | 2 +-
hardware/Yeelight.h | 1 -
hardware/ZiBlueSerial.cpp | 2 ++
hardware/plugins/PluginTransports.cpp | 2 ++
main/WebServer.cpp | 4 +++-
main/mainworker.cpp | 2 ++
push/FibaroPush.cpp | 2 ++
push/GooglePubSubPush.cpp | 2 ++
push/HttpPush.cpp | 2 ++
push/InfluxPush.cpp | 2 ++
push/WebsocketPush.cpp | 2 ++
tcpserver/TCPServer.cpp | 2 +-
webserver/cWebem.cpp | 2 +-
webserver/connection.cpp | 4 +++-
webserver/connection_manager.cpp | 4 +++-
webserver/proxyclient.cpp | 2 ++
webserver/server.cpp | 4 +++-
49 files changed, 107 insertions(+), 32 deletions(-)
--- a/hardware/ASyncSerial.cpp
+++ b/hardware/ASyncSerial.cpp
@@ -34,7 +34,7 @@
#include <algorithm>
#include <iostream>
#include <boost/asio.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/function.hpp>
#include <boost/thread.hpp>
#include <boost/smart_ptr/shared_array.hpp> // for shared_array
--- a/hardware/ASyncTCP.cpp
+++ b/hardware/ASyncTCP.cpp
@@ -1,10 +1,12 @@
#include "stdafx.h"
#include "ASyncTCP.h"
#include <boost/asio.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/system/error_code.hpp> // for error_code
#include "../main/Logger.h"
+//using namespace boost::placeholders;
+
struct hostent;
#ifndef WIN32
--- a/hardware/Comm5Serial.cpp
+++ b/hardware/Comm5Serial.cpp
@@ -5,6 +5,8 @@
#include "../main/Logger.h"
#include "../main/RFXtrx.h"
+using namespace boost::placeholders;
+
/*
This driver allows Domoticz to control any I/O module from the MA-4xxx Family
--- a/hardware/CurrentCostMeterSerial.cpp
+++ b/hardware/CurrentCostMeterSerial.cpp
@@ -10,10 +10,12 @@
#include <string>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <ctime>
+using namespace boost::placeholders;
+
//
//Class CurrentCostMeterSerial
//
--- a/hardware/DavisLoggerSerial.cpp
+++ b/hardware/DavisLoggerSerial.cpp
@@ -8,13 +8,15 @@
#include <string>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "../main/localtime_r.h"
#include "../main/mainworker.h"
#include <ctime>
+using namespace boost::placeholders;
+
#ifdef _DEBUG
//#define DEBUG_DAVIS
#endif
--- a/hardware/DenkoviUSBDevices.cpp
+++ b/hardware/DenkoviUSBDevices.cpp
@@ -5,6 +5,8 @@
#include "../main/localtime_r.h"
#include "../main/mainworker.h"
+using namespace boost::placeholders;
+
#define MAX_POLL_INTERVAL 3600*1000
#define DAE_IO_TYPE_RELAY 2
--- a/hardware/EnOceanESP2.cpp
+++ b/hardware/EnOceanESP2.cpp
@@ -8,7 +8,7 @@
#include <string>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "hardwaretypes.h"
#include "../main/localtime_r.h"
@@ -16,6 +16,8 @@
#include <cmath>
#include <ctime>
+using namespace boost::placeholders;
+
#define ENOCEAN_RETRY_DELAY 30
#define round(a) ( int ) ( a + .5 )
--- a/hardware/EnOceanESP3.cpp
+++ b/hardware/EnOceanESP3.cpp
@@ -8,7 +8,7 @@
#include <string>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "hardwaretypes.h"
#include "../main/localtime_r.h"
@@ -16,6 +16,8 @@
#include <cmath>
#include <ctime>
+using namespace boost::placeholders;
+
#if _DEBUG
#define ENOCEAN_BUTTON_DEBUG
#endif
--- a/hardware/EvohomeRadio.cpp
+++ b/hardware/EvohomeRadio.cpp
@@ -23,6 +23,9 @@
#include "../main/WebServer.h"
#include "../webserver/cWebem.h"
#include <json/json.h>
+#include <boost/bind/bind.hpp>
+
+using namespace boost::placeholders;
extern std::string szUserDataFolder;
--- a/hardware/EvohomeSerial.cpp
+++ b/hardware/EvohomeSerial.cpp
@@ -7,6 +7,8 @@
#include "../main/localtime_r.h"
#include <boost/exception/diagnostic_information.hpp>
+using namespace boost::placeholders;
+
CEvohomeSerial::CEvohomeSerial(const int ID, const std::string &szSerialPort, const int baudrate, const std::string &UserContID) :
CEvohomeRadio(ID, UserContID)
{
--- a/hardware/KMTronic433.cpp
+++ b/hardware/KMTronic433.cpp
@@ -9,11 +9,13 @@
#include <string>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <ctime>
+using namespace boost::placeholders;
+
//#define DEBUG_KMTronic
#define RETRY_DELAY 30
--- a/hardware/KMTronicBase.cpp
+++ b/hardware/KMTronicBase.cpp
@@ -10,7 +10,7 @@
#include <sstream>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <ctime>
--- a/hardware/KMTronicSerial.cpp
+++ b/hardware/KMTronicSerial.cpp
@@ -10,12 +10,14 @@
#include <string>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <ctime>
//#define DEBUG_KMTronic
+using namespace boost::placeholders;
+
#define RETRY_DELAY 30
KMTronicSerial::KMTronicSerial(const int ID, const std::string& devname)
--- a/hardware/MQTT.cpp
+++ b/hardware/MQTT.cpp
@@ -11,6 +11,8 @@
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
+using namespace boost::placeholders;
+
#define RETRY_DELAY 30
#define CLIENTID "Domoticz"
--- a/hardware/Meteostick.cpp
+++ b/hardware/Meteostick.cpp
@@ -9,12 +9,14 @@
#include <string>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "../main/localtime_r.h"
#include "../main/mainworker.h"
#include <ctime>
+using namespace boost::placeholders;
+
#define RETRY_DELAY 30
#define round(a) ( int ) ( a + .5 )
--- a/hardware/MySensorsBase.cpp
+++ b/hardware/MySensorsBase.cpp
@@ -13,7 +13,7 @@
#include <sstream>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "../webserver/cWebem.h"
#include <json/json.h>
--- a/hardware/MySensorsSerial.cpp
+++ b/hardware/MySensorsSerial.cpp
@@ -8,12 +8,14 @@
#include "hardwaretypes.h"
#include <algorithm>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <ctime>
#include <iostream>
#include <string>
+using namespace boost::placeholders;
+
//#define DEBUG_MYSENSORS
#define RETRY_DELAY 30
--- a/hardware/OTGWBase.cpp
+++ b/hardware/OTGWBase.cpp
@@ -12,7 +12,7 @@
#include <string>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <json/json.h>
#include <ctime>
--- a/hardware/OTGWSerial.cpp
+++ b/hardware/OTGWSerial.cpp
@@ -8,12 +8,14 @@
#include "../main/localtime_r.h"
#include <algorithm>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <ctime>
#include <iostream>
#include <string>
+using namespace boost::placeholders;
+
#define RETRY_DELAY 30
#define OTGW_READ_INTERVAL 10
--- a/hardware/OpenWebNetUSB.cpp
+++ b/hardware/OpenWebNetUSB.cpp
@@ -19,11 +19,12 @@ License: Public domain
#include <algorithm>
#include <ctime>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <iostream>
#include <string>
+using namespace boost::placeholders;
COpenWebNetUSB::COpenWebNetUSB(const int ID, const std::string& devname, unsigned int baud_rate)
{
--- a/hardware/P1MeterSerial.cpp
+++ b/hardware/P1MeterSerial.cpp
@@ -14,10 +14,12 @@
#include <string>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <ctime>
+using namespace boost::placeholders;
+
#ifdef _DEBUG
//#define DEBUG_P1_R
#endif
--- a/hardware/Pinger.cpp
+++ b/hardware/Pinger.cpp
@@ -19,6 +19,8 @@
#include <iostream>
+using namespace boost::placeholders;
+
#if BOOST_VERSION >= 107000
#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
#else
--- a/hardware/RAVEn.cpp
+++ b/hardware/RAVEn.cpp
@@ -8,6 +8,8 @@
#include "../tinyxpath/tinyxml.h"
#include "hardwaretypes.h"
+using namespace boost::placeholders;
+
//Rainforest RAVEn USB ZigBee Smart Meter Adapter
//https://rainforestautomation.com/rfa-z106-raven/
--- a/hardware/RFLinkSerial.cpp
+++ b/hardware/RFLinkSerial.cpp
@@ -5,6 +5,8 @@
#include "../main/localtime_r.h"
#include <boost/exception/diagnostic_information.hpp>
+using namespace boost::placeholders;
+
CRFLinkSerial::CRFLinkSerial(const int ID, const std::string& devname) :
m_szSerialPort(devname)
{
--- a/hardware/RFXComSerial.cpp
+++ b/hardware/RFXComSerial.cpp
@@ -12,7 +12,7 @@
#include <string>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <ctime>
@@ -23,6 +23,8 @@
#include <pwd.h>
#endif
+using namespace boost::placeholders;
+
#define RETRY_DELAY 30
#define RFX_WRITE_DELAY 300
--- a/hardware/RFXComTCP.cpp
+++ b/hardware/RFXComTCP.cpp
@@ -1,8 +1,6 @@
#include "stdafx.h"
#include "RFXComTCP.h"
#include "../main/Logger.h"
-//#include <boost/bind.hpp>
-//#include <boost/asio.hpp>
#include "../main/Helper.h"
#include "../main/localtime_r.h"
#include "../main/mainworker.h"
--- a/hardware/Rego6XXSerial.cpp
+++ b/hardware/Rego6XXSerial.cpp
@@ -16,11 +16,13 @@
#include <string>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "hardwaretypes.h"
#include <ctime>
+using namespace boost::placeholders;
+
#define Rego6XX_RETRY_DELAY 30
#define Rego6XX_COMMAND_DELAY 5
#define Rego6XX_READ_BUFFER_MASK (Rego6XX_READ_BUFFER_SIZE - 1)
--- a/hardware/S0MeterBase.cpp
+++ b/hardware/S0MeterBase.cpp
@@ -13,7 +13,7 @@
#include <string>
#include <algorithm>
#include <iostream>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <ctime>
--- a/hardware/S0MeterSerial.cpp
+++ b/hardware/S0MeterSerial.cpp
@@ -8,11 +8,13 @@
#include <algorithm>
#include <ctime>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <iostream>
#include <string>
+using namespace boost::placeholders;
+
#ifdef _DEBUG
//#define DEBUG_S0
#define TOT_DEBUG_LINES 6
--- a/hardware/TCPProxy/tcpproxy_server.cpp
+++ b/hardware/TCPProxy/tcpproxy_server.cpp
@@ -15,6 +15,8 @@
#include "stdafx.h"
#include "tcpproxy_server.h"
+using namespace boost::placeholders;
+
#if BOOST_VERSION >= 107000
#define GET_IO_SERVICE(s) ((boost::asio::io_context&)(s).get_executor().context())
#else
--- a/hardware/TeleinfoSerial.cpp
+++ b/hardware/TeleinfoSerial.cpp
@@ -28,9 +28,11 @@ History :
#include "../main/localtime_r.h"
#include "../main/Logger.h"
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/exception/diagnostic_information.hpp>
+using namespace boost::placeholders;
+
CTeleinfoSerial::CTeleinfoSerial(const int ID, const std::string& devname, const int datatimeout, unsigned int baud_rate, const bool disable_crc, const int ratelimit)
{
m_HwdID = ID;
--- a/hardware/USBtin.cpp
+++ b/hardware/USBtin.cpp
@@ -27,7 +27,7 @@ History :
#include "../main/SQLHelper.h"
#include <algorithm>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <cstdlib>
#include <ctime>
@@ -35,6 +35,8 @@ History :
#include <string>
#include <time.h>
+using namespace boost::placeholders;
+
#define USBTIN_BAUD_RATE 115200
#define USBTIN_PARITY boost::asio::serial_port_base::parity::none
#define USBTIN_CARACTER_SIZE 8
--- a/hardware/XiaomiGateway.cpp
+++ b/hardware/XiaomiGateway.cpp
@@ -12,7 +12,7 @@
#include "XiaomiHardware.h"
#include <openssl/aes.h>
#include <boost/asio.hpp>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#ifndef WIN32
#include <ifaddrs.h>
--- a/hardware/Yeelight.h
+++ b/hardware/Yeelight.h
@@ -2,7 +2,6 @@
#include "DomoticzHardware.h"
#include <boost/asio.hpp>
-#include <boost/bind.hpp>
class Yeelight : public CDomoticzHardwareBase
{
--- a/hardware/ZiBlueSerial.cpp
+++ b/hardware/ZiBlueSerial.cpp
@@ -6,6 +6,8 @@
#include <boost/exception/diagnostic_information.hpp>
+using namespace boost::placeholders;
+
#define ZiBlue_RETRY_DELAY 30
CZiBlueSerial::CZiBlueSerial(const int ID, const std::string& devname) :
--- a/hardware/plugins/PluginTransports.cpp
+++ b/hardware/plugins/PluginTransports.cpp
@@ -13,6 +13,8 @@
#include "icmp_header.hpp"
#include "ipv4_header.hpp"
+using namespace boost::placeholders;
+
namespace Plugins {
void CPluginTransport::handleRead(const boost::system::error_code& e, std::size_t bytes_transferred)
--- a/main/WebServer.cpp
+++ b/main/WebServer.cpp
@@ -1,7 +1,7 @@
#include "stdafx.h"
#include "WebServer.h"
#include "WebServerHelper.h"
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <iostream>
#include <fstream>
#include "mainworker.h"
@@ -65,6 +65,8 @@
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
+using namespace boost::placeholders;
+
#define round(a) ( int ) ( a + .5 )
extern std::string szStartupFolder;
--- a/main/mainworker.cpp
+++ b/main/mainworker.cpp
@@ -174,6 +174,8 @@
#include <fstream>
#endif
+using namespace boost::placeholders;
+
#define round(a) ( int ) ( a + .5 )
extern std::string szStartupFolder;
--- a/push/FibaroPush.cpp
+++ b/push/FibaroPush.cpp
@@ -14,6 +14,8 @@
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
+using namespace boost::placeholders;
+
CFibaroPush::CFibaroPush()
{
m_PushType = PushType::PUSHTYPE_FIBARO;
--- a/push/GooglePubSubPush.cpp
+++ b/push/GooglePubSubPush.cpp
@@ -21,6 +21,8 @@ extern "C" {
#include <boost/python.hpp>
#endif
+using namespace boost::placeholders;
+
extern std::string szUserDataFolder;
// this should be filled in by the preprocessor
--- a/push/HttpPush.cpp
+++ b/push/HttpPush.cpp
@@ -15,6 +15,8 @@
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
+using namespace boost::placeholders;
+
CHttpPush::CHttpPush()
{
m_PushType = PushType::PUSHTYPE_HTTP;
--- a/push/InfluxPush.cpp
+++ b/push/InfluxPush.cpp
@@ -15,6 +15,8 @@
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
+using namespace boost::placeholders;
+
CInfluxPush::CInfluxPush() :
m_InfluxPort(8086),
m_bInfluxDebugActive(false)
--- a/push/WebsocketPush.cpp
+++ b/push/WebsocketPush.cpp
@@ -3,6 +3,8 @@
#include "../webserver/WebsocketHandler.h"
#include "../main/mainworker.h"
+using namespace boost::placeholders;
+
extern boost::signals2::signal<void(const std::string &Subject, const std::string &Text, const std::string &ExtraData, const int Priority, const std::string & Sound, const bool bFromNotification)> sOnNotificationReceived;
--- a/tcpserver/TCPServer.cpp
+++ b/tcpserver/TCPServer.cpp
@@ -11,7 +11,7 @@
#include "../main/localtime_r.h"
#include <boost/asio.hpp>
#include <algorithm>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
namespace tcp {
namespace server {
--- a/webserver/cWebem.cpp
+++ b/webserver/cWebem.cpp
@@ -5,7 +5,7 @@
//Modified, extended etc by Robbert E. Peters/RTSS B.V.
#include "stdafx.h"
#include "cWebem.h"
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "reply.hpp"
#include "request.hpp"
#include "mime_types.hpp"
--- a/webserver/connection.cpp
+++ b/webserver/connection.cpp
@@ -9,7 +9,7 @@
//
#include "stdafx.h"
#include "connection.hpp"
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <boost/algorithm/string.hpp>
#include "connection_manager.hpp"
#include "request_handler.hpp"
@@ -17,6 +17,8 @@
#include "../main/localtime_r.h"
#include "../main/Logger.h"
+using namespace boost::placeholders;
+
namespace http {
namespace server {
extern std::string convert_to_http_date(time_t time);
--- a/webserver/connection_manager.cpp
+++ b/webserver/connection_manager.cpp
@@ -10,10 +10,12 @@
#include "stdafx.h"
#include "connection_manager.hpp"
#include <algorithm>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <iostream>
#include "../main/Logger.h"
+using namespace boost::placeholders;
+
namespace http {
namespace server {
--- a/webserver/proxyclient.cpp
+++ b/webserver/proxyclient.cpp
@@ -8,6 +8,8 @@
#include "../tcpserver/TCPServer.h"
#include "sha1.hpp"
+using namespace boost::placeholders;
+
// RK: some defines to make mydomoticz also work when openssl not compiled in
#ifdef WWW_ENABLE_SSL
#define PROXY_PORT 443
--- a/webserver/server.cpp
+++ b/webserver/server.cpp
@@ -3,7 +3,7 @@
// ~~~~~~~~~~
//
#include "stdafx.h"
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include "server.hpp"
#include <fstream>
#include "../main/Logger.h"
@@ -11,6 +11,8 @@
#include "../main/localtime_r.h"
#include "../main/mainworker.h"
+using namespace boost::placeholders;
+
extern bool g_bIsWSL;
namespace http {