]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix compilation by adding a missing <optional> include in misc.cc 11436/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 21 Mar 2022 08:52:19 +0000 (09:52 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 21 Mar 2022 08:53:14 +0000 (09:53 +0100)
Otherwise g++ 11.2.0 complains here:
```
misc.cc: In function ‘int makeIPv6sockaddr(const string&, sockaddr_in6*)’:
misc.cc:711:8: error: ‘optional’ is not a member of ‘std’
  711 |   std::optional<uint16_t> port = std::nullopt;
      |        ^~~~~~~~
misc.cc:61:1: note: ‘std::optional’ is defined in header ‘<optional>’; did you forget to ‘#include <optional>’?
```

pdns/misc.cc

index 486511d46e141882531919bb98b2927b61fa7eb4..ac5f74888bb3bef956e8b720d6ffc08a3786c69c 100644 (file)
@@ -45,6 +45,7 @@
 #include <poll.h>
 #include <iomanip>
 #include <netinet/tcp.h>
+#include <optional>
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>