]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4100] Fix compatibility with LLVM libc++ 21
authorAndrei Pavel <andrei@isc.org>
Thu, 23 Oct 2025 11:35:15 +0000 (14:35 +0300)
committerAndrei Pavel <andrei@isc.org>
Thu, 23 Oct 2025 11:35:15 +0000 (14:35 +0300)
src/bin/d2/d2_queue_mgr.h
src/hooks/dhcp/radius/radius_accounting.h
src/lib/asiodns/io_fetch.h
src/lib/cryptolink/cryptolink.h
src/lib/d2srv/dns_client.h
src/lib/d2srv/nc_trans.cc
src/lib/dhcp_ddns/ncr_io.h
src/lib/dhcpsrv/host.h
src/lib/dhcpsrv/lease.h

index b201446c4d7bcb5c1522a18cf05a38cebc7981f7..4c730b83b146c8b3fabaf3ca707da57544abd03e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -135,14 +135,14 @@ public:
     static const size_t MAX_QUEUE_DEFAULT = 1024;
 
     /// @brief Defines the list of possible states for D2QueueMgr.
-    enum State {
-      NOT_INITTED,
-      INITTED,
-      RUNNING,
-      STOPPING,
-      STOPPED_QUEUE_FULL,
-      STOPPED_RECV_ERROR,
-      STOPPED,
+    enum State : int {
+      NOT_INITTED = 0,
+      INITTED = 1,
+      RUNNING = 2,
+      STOPPING = 3,
+      STOPPED_QUEUE_FULL = 4,
+      STOPPED_RECV_ERROR = 5,
+      STOPPED = 6,
     };
 
     /// @brief Constructor
index aeb9b973cba13305fce0886b47499b1f6558bde5..52a05684293f58e179ca0ff5828d399576bedb2e 100644 (file)
@@ -22,17 +22,17 @@ namespace isc {
 namespace radius {
 
 /// @brief Type of accounting events.
-typedef enum {
-    EVENT_CREATE,  //< A new lease was created (leaseX_select hooks).
-    EVENT_RENEW,   //< A lease was renewed (leaseX_renew hooks).
-    EVENT_REBIND,  //< A lease was rebound (lease6_rebind hook).
-    EVENT_EXPIRE,  //< A lease was expired (leaseX_expire hooks).
-    EVENT_RELEASE, //< A lease was released (leaseX_release hooks).
-    EVENT_DECLINE, //< A lease was declined (leaseX_decline hooks).
-    EVENT_ADD,     //< A command added a lease (command_processed hook).
-    EVENT_UPDATE,  //< A command updated a lease (command_processed hook).
-    EVENT_DEL      //< A command deleted a lease (command_processed hook).
-} Event;
+enum Event : int {
+    EVENT_CREATE = 0,  //< A new lease was created (leaseX_select hooks).
+    EVENT_RENEW = 1,   //< A lease was renewed (leaseX_renew hooks).
+    EVENT_REBIND = 2,  //< A lease was rebound (lease6_rebind hook).
+    EVENT_EXPIRE = 3,  //< A lease was expired (leaseX_expire hooks).
+    EVENT_RELEASE = 4, //< A lease was released (leaseX_release hooks).
+    EVENT_DECLINE = 5, //< A lease was declined (leaseX_decline hooks).
+    EVENT_ADD = 6,     //< A command added a lease (command_processed hook).
+    EVENT_UPDATE = 7,  //< A command updated a lease (command_processed hook).
+    EVENT_DEL = 8,     //< A command deleted a lease (command_processed hook).
+};
 
 /// @brief Translate an event to text.
 ///
index 3053cc2e0a2d10711577d5640d2262a5635e001a..8bdda974e814630de56ace2d61a8b9236b675c71 100644 (file)
@@ -56,7 +56,7 @@ public:
     /// @note that this applies to the status of I/Os in the fetch - a fetch that
     /// resulted in a packet being received from the server is a SUCCESS, even if
     /// the contents of the packet indicate that some error occurred.
-    enum Result {
+    enum Result : int {
         SUCCESS = 0,       // Success, fetch completed
         TIME_OUT = 1,      // Failure, fetch timed out
         STOPPED = 2,       // Control code, fetch has been stopped
index 7c2f596978de1fceda5bda4bfc139aabe8eee73c..6dd375a2588ee087a33fca26333727b133a78b49 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -20,7 +20,7 @@ namespace isc {
 namespace cryptolink {
 
 /// @brief Hash algorithm identifiers.
-enum HashAlgorithm {
+enum HashAlgorithm : int {
     UNKNOWN_HASH = 0,   // This value can be used in conversion
                         // functions, to be returned when the
                         // input is unknown (but a value MUST be
index 831a233683c0eac27bb8e5c6fdfa085f39dc24d3..cf2f60f4acce65132227d7ef1462605f1c83e69d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -55,12 +55,12 @@ public:
     };
 
     /// @brief A status code of the DNSClient.
-    enum Status {
-        SUCCESS,           ///< Response received and is ok.
-        TIMEOUT,           ///< No response, timeout.
-        IO_STOPPED,        ///< IO was stopped.
-        INVALID_RESPONSE,  ///< Response received but invalid.
-        OTHER              ///< Other, unclassified error.
+    enum Status : int {
+        SUCCESS = 0,            ///< Response received and is ok.
+        TIMEOUT = 1,            ///< No response, timeout.
+        IO_STOPPED = 2,         ///< IO was stopped.
+        INVALID_RESPONSE = 3,   ///< Response received but invalid.
+        OTHER = 4,              ///< Other, unclassified error.
     };
 
     /// @brief Callback for the @c DNSClient class.
index 4fd822e1b6db27b529437d5f8abd8363305019a8..434a39bd5fcb908a0a484ba03fc2e643dbe69912 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -158,8 +158,7 @@ NameChangeTransaction::responseString() const {
             stream << "OTHER";
             break;
         default:
-            stream << "UNKNOWN("
-                   << static_cast<int>(getDnsUpdateStatus()) << ")";
+            stream << "UNKNOWN(" << getDnsUpdateStatus() << ")";
             break;
 
     }
index 8bde34bd13170793b8ab4ba748cbf03ca8ba5c26..f759d4332bc0a6ddbd1b598339225f0ab749c4fb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -475,11 +475,11 @@ public:
     static const size_t MAX_QUEUE_DEFAULT = 1024;
 
     /// @brief Defines the outcome of an asynchronous NCR send.
-    enum Result {
-        SUCCESS,
-        TIME_OUT,
-        STOPPED,
-        ERROR
+    enum Result : int {
+        SUCCESS = 0,
+        TIME_OUT = 1,
+        STOPPED = 2,
+        ERROR = 3,
     };
 
     /// @brief Abstract class for defining application layer send callbacks.
index 13c98ff36464b8014906ce0a8f734f6013070824..620afe1391005887fdb76a9cce2e6677c7a918b8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2025 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -334,12 +334,12 @@ public:
     /// - DUID (DHCPv4 and DHCPv6) (identifier name: "duid"),
     /// - circuit identifier (DHCPv4) (identifier name: "circuit-id"),
     /// - client identifier (DHCPv4) (identifier name: "client-id")
-    enum IdentifierType {
-        IDENT_HWADDR,
-        IDENT_DUID,
-        IDENT_CIRCUIT_ID,
-        IDENT_CLIENT_ID,
-        IDENT_FLEX, ///< Flexible host identifier.
+    enum IdentifierType : int {
+        IDENT_HWADDR = 0,
+        IDENT_DUID = 1,
+        IDENT_CIRCUIT_ID = 2,
+        IDENT_CLIENT_ID = 3,
+        IDENT_FLEX = 4,  ///< Flexible host identifier.
     };
 
     /// @brief Constant pointing to the last identifier of the
index 479f1c5e99e209c6a066cbad273758736557b8c7..9618fd5ee83c02132056360441fa97227b163dd1 100644 (file)
@@ -43,12 +43,12 @@ struct Lease : public isc::data::UserContext, public isc::data::CfgToElement {
     static std::string lifetimeToText(uint32_t lifetime);
 
     /// @brief Type of lease or pool
-    typedef enum {
+    enum Type : int {
         TYPE_NA = 0, ///< the lease contains non-temporary IPv6 address
         TYPE_TA = 1, ///< the lease contains temporary IPv6 address
         TYPE_PD = 2, ///< the lease contains IPv6 prefix (for prefix delegation)
-        TYPE_V4 = 3  ///< IPv4 lease
-    } Type;
+        TYPE_V4 = 3, ///< IPv4 lease
+    };
 
     /// @brief returns text representation of a lease type
     /// @param type lease or pool type to be converted