Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit a2ec204

Browse files
authored
Merge pull request #711 from bourtemb/delleceste-openbsd-fix-706
Fix compilation errors on OpenBSD (#706)
2 parents c958c57 + 59931b9 commit a2ec204

File tree

13 files changed

+11
-64
lines changed

13 files changed

+11
-64
lines changed

cpp_test_suite/old_tests/lock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <process.h>
1010
#define WEXITSTATUS(w) w
1111
#else
12-
#include <wait.h>
12+
#include <sys/wait.h>
1313
#endif
1414

1515
#include "locked_device_cmd.h"

cppapi/client/lockthread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct LockedDevice
6666
std::string dev_name; // The locked device name
6767
DevLong validity; // The locked device validity
6868

69-
bool operator<(LockedDevice &arg) {return validity < arg.validity;}
69+
bool operator<(const LockedDevice &arg) const {return validity < arg.validity;}
7070
};
7171

7272
enum LockCmdType

cppapi/client/zmqeventconsumer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
#include <sys/types.h>
5151
#include <fcntl.h>
5252
#include <arpa/inet.h>
53+
#include <netinet/in.h> // Needed for systems that do not include this file from arpa/inet.h
5354
#endif
5455

5556
using namespace CORBA;
@@ -4103,4 +4104,3 @@ void DelayEvent::release()
41034104
}
41044105

41054106
} /* End of Tango namespace */
4106-

cppapi/server/attribute.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ void Attribute::build_check_enum_labels(std::string &labs)
12821282

12831283
void Attribute::add_startup_exception(std::string prop_name,const DevFailed &except)
12841284
{
1285-
startup_exceptions.insert(std::pair<std::string,const DevFailed>(prop_name,except));
1285+
startup_exceptions.insert(std::pair<std::string, DevFailed>(prop_name,except));
12861286
check_startup_exceptions = true;
12871287
}
12881288

@@ -1306,7 +1306,7 @@ void Attribute::delete_startup_exception(std::string prop_name,std::string dev_n
13061306
{
13071307
if(check_startup_exceptions == true)
13081308
{
1309-
std::map<std::string,const DevFailed>::iterator it = startup_exceptions.find(prop_name);
1309+
std::map<std::string, DevFailed>::iterator it = startup_exceptions.find(prop_name);
13101310
if(it != startup_exceptions.end())
13111311
startup_exceptions.erase(it);
13121312
if(startup_exceptions.empty() == true)

cppapi/server/attribute.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,7 +2514,7 @@ class Attribute
25142514
std::vector<std::string> mcast_event; // In case of multicasting used for event transport
25152515
AttrQuality old_quality; // Previous attribute quality
25162516
std::bitset<numFlags> old_alarm; // Previous attribute alarm
2517-
std::map<std::string,const DevFailed> startup_exceptions; // Map containing exceptions related to attribute configuration raised during the server startup sequence
2517+
std::map<std::string, DevFailed> startup_exceptions; // Map containing exceptions related to attribute configuration raised during the server startup sequence
25182518
bool check_startup_exceptions; // Flag set to true if there is at least one exception in startup_exceptions map
25192519
bool startup_exceptions_clear; // Flag set to true when the cause for the device startup exceptions has been fixed
25202520
bool att_mem_exception; // Flag set to true if the attribute is writable and
@@ -2570,7 +2570,7 @@ inline void Attribute::throw_startup_exception(const char* origin)
25702570
std::string err_msg;
25712571
std::vector<std::string> event_exceptions;
25722572
std::vector<std::string> opt_exceptions;
2573-
for(std::map<std::string,const DevFailed>::iterator it = startup_exceptions.begin(); it != startup_exceptions.end(); ++it)
2573+
for(std::map<std::string, DevFailed>::const_iterator it = startup_exceptions.begin(); it != startup_exceptions.end(); ++it)
25742574
{
25752575
if(it->first == "event_period" || it->first == "archive_period" || it->first == "rel_change" || it->first == "abs_change" || it->first == "archive_rel_change" || it->first == "archive_abs_change")
25762576
event_exceptions.push_back(it->first);

cppapi/server/dserversignal.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,6 @@ void DServerSignal::register_class_signal(long signo,bool handler,DeviceClass *c
269269
(const char *)"DServerSignal::register_class_signal");
270270
}
271271

272-
if (auth_signal(signo) == false)
273-
{
274-
TangoSys_OMemStream o;
275-
o << "Signal " << sig_name[signo] << "is not authorized with your OS" << std::ends;
276-
Except::throw_exception((const char *)API_SignalOutOfRange,
277-
o.str(),
278-
(const char *)"DServerSignal::register_class_signal");
279-
}
280-
281272
#ifndef _TG_WINDOWS_
282273
if ((auto_signal(signo) == true) && (handler == true))
283274
{
@@ -385,15 +376,6 @@ void DServerSignal::register_dev_signal(long signo,bool handler,DeviceImpl *dev_
385376
(const char *)"DServerSignal::register_dev_signal");
386377
}
387378

388-
if (auth_signal(signo) == false)
389-
{
390-
TangoSys_OMemStream o;
391-
o << "Signal " << sig_name[signo] << "is not authorized with your OS" << std::ends;
392-
Except::throw_exception((const char *)API_SignalOutOfRange,
393-
o.str(),
394-
(const char *)"DServerSignal::register_dev_signal");
395-
}
396-
397379
#ifndef _TG_WINDOWS_
398380
if ((auto_signal(signo) == true) && (handler == true))
399381
{

cppapi/server/dserversignal.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,6 @@ protected :
150150
}
151151
#endif
152152

153-
#if (defined __GLIBC__ || defined __darwin__ || defined __freebsd__)
154-
static inline bool auth_signal(TANGO_UNUSED(long s)) {return true;}
155-
#endif
156-
157-
#ifdef _TG_WINDOWS_
158-
static inline bool auth_signal(long s) {return true;}
159-
#endif
160-
161153
static std::string sig_name[_NSIG];
162154

163155
};

log4tango/include/log4tango/LoggingEvent.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include <log4tango/Portability.hh>
3232
#include <string>
33+
#include <thread>
3334

3435
#include <log4tango/Level.hh>
3536
#include <log4tango/TimeStamp.hh>
@@ -92,7 +93,7 @@ public:
9293
std::string thread_name;
9394

9495
/** id of thread in which this logging event was generated */
95-
long thread_id;
96+
std::thread::id thread_id;
9697

9798
/** The number of seconds elapsed since the epoch
9899
(1/1/1970 00:00:00 UTC) until logging event was created. */

log4tango/include/log4tango/threading/MSThreads.hh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ namespace threading {
6666

6767
std::string get_thread_id (void);
6868

69-
long thread_id (void);
70-
7169
//-----------------------------------------------------------------------------
7270
// Class : MSMutex
7371
//-----------------------------------------------------------------------------

log4tango/include/log4tango/threading/PThreads.hh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ namespace threading {
4040

4141
std::string get_thread_id (void);
4242

43-
long thread_id (void);
44-
4543
//-----------------------------------------------------------------------------
4644
// Class : Mutex
4745
//-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)