Package: ppl / 0.10.2-8

1fa465112d1f5519310f47de08494b765c420b8f.debian Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
From: Roberto Bagnara <bagnara@cs.unipr.it>
Date: Sun, 21 Feb 2010 10:16:27 +0000 (+0100)
Subject: If setitimer() is not available, no initialization is necessary.
X-Git-Url: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl%2Fppl.git;a=commitdiff_plain;h=1fa465112d1f5519310f47de08494b765c420b8f

If setitimer() is not available, no initialization is necessary.
This also works around a linking bug in Mingw.
C tests improved with error-handling code.
---

diff --git a/Watchdog/src/Watchdog.cc b/Watchdog/src/Watchdog.cc
index 68ed01f..84ccda3 100644
--- a/Watchdog/src/Watchdog.cc
+++ b/Watchdog/src/Watchdog.cc
@@ -242,6 +242,6 @@ void
 PWL::Watchdog::finalize() {
 }
 
-#endif // PWL_HAVE_DECL_SETITIMER
-
 unsigned int PWL::Init::count = 0;
+
+#endif // PWL_HAVE_DECL_SETITIMER
diff --git a/Watchdog/src/Watchdog.defs.hh b/Watchdog/src/Watchdog.defs.hh
index a6ec958..674954d 100644
--- a/Watchdog/src/Watchdog.defs.hh
+++ b/Watchdog/src/Watchdog.defs.hh
@@ -136,6 +136,8 @@ private:
 #endif // PWL_HAVE_DECL_SETITIMER
 };
 
+#if PWL_HAVE_DECL_SETITIMER
+
 class Init {
 private:
   //! Count the number of objects created.
@@ -149,15 +151,21 @@ public:
   ~Init();
 };
 
+#endif // PWL_HAVE_DECL_SETITIMER
+
 } // namespace Parma_Watchdog_Library
 
 #include "Watchdog.inlines.hh"
 
+#if PWL_HAVE_DECL_SETITIMER
+
 namespace {
 
 Parma_Watchdog_Library::Init Parma_Watchdog_Library_initializer;
 
 } // namespace
 
+#endif // PWL_HAVE_DECL_SETITIMER
+
 #endif // !defined(PWL_Watchdog_defs_hh)
 
diff --git a/Watchdog/src/Watchdog.inlines.hh b/Watchdog/src/Watchdog.inlines.hh
index 80258dd..6cdd654 100644
--- a/Watchdog/src/Watchdog.inlines.hh
+++ b/Watchdog/src/Watchdog.inlines.hh
@@ -109,22 +109,6 @@ inline
 Watchdog::~Watchdog() {
 }
 
-inline
-Init::Init() {
-  // Only when the first Init object is constructed...
-  if (count++ == 0) {
-    // ... the library is initialized.
-  }
-}
-
-inline
-Init::~Init() {
-  // Only when the last Init object is destroyed...
-  if (--count == 0) {
-    // ... the library is finalized.
-  }
-}
-
 #endif // !PWL_HAVE_DECL_SETITIMER
 
 } // namespace Parma_Watchdog_Library