build: prepend "NFD_" to various macro names to avoid conflicts

Change-Id: Icc370968e3d38fef80ece35a2aed56450f54b653
diff --git a/daemon/face/face-system.hpp b/daemon/face/face-system.hpp
index 84a2dce..3b2e3dc 100644
--- a/daemon/face/face-system.hpp
+++ b/daemon/face/face-system.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -100,7 +100,7 @@
     bool isDryRun;
   };
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   ProtocolFactoryCtorParams
   makePFCtorParams();
 
@@ -109,7 +109,7 @@
   processConfig(const ConfigSection& configSection, bool isDryRun,
                 const std::string& filename);
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /** \brief config section name => protocol factory
    */
   std::map<std::string, unique_ptr<ProtocolFactory>> m_factories;
diff --git a/daemon/face/face.hpp b/daemon/face/face.hpp
index 8228885..0076f85 100644
--- a/daemon/face/face.hpp
+++ b/daemon/face/face.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -51,7 +51,7 @@
  *  LinkService is the upper part, which translates between network-layer packets
  *  and TLV blocks, and may provide additional services such as fragmentation and reassembly.
  */
-class Face FINAL_UNLESS_WITH_TESTS : public std::enable_shared_from_this<Face>, noncopyable
+class Face NFD_FINAL_UNLESS_WITH_TESTS : public std::enable_shared_from_this<Face>, noncopyable
 {
 public:
   Face(unique_ptr<LinkService> service, unique_ptr<Transport> transport);
diff --git a/daemon/face/generic-link-service.hpp b/daemon/face/generic-link-service.hpp
index 7a1dd4f..7a86b09 100644
--- a/daemon/face/generic-link-service.hpp
+++ b/daemon/face/generic-link-service.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -93,8 +93,8 @@
 /** \brief GenericLinkService is a LinkService that implements the NDNLPv2 protocol
  *  \sa https://redmine.named-data.net/projects/nfd/wiki/NDNLPv2
  */
-class GenericLinkService FINAL_UNLESS_WITH_TESTS : public LinkService
-                                                 , protected virtual GenericLinkServiceCounters
+class GenericLinkService NFD_FINAL_UNLESS_WITH_TESTS : public LinkService
+                                                     , protected virtual GenericLinkServiceCounters
 {
 public:
   /** \brief Options that control the behavior of GenericLinkService
@@ -184,10 +184,10 @@
   setOptions(const Options& options);
 
   const Counters&
-  getCounters() const OVERRIDE_WITH_TESTS_ELSE_FINAL;
+  getCounters() const NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
 
   ssize_t
-  getEffectiveMtu() const OVERRIDE_WITH_TESTS_ELSE_FINAL;
+  getEffectiveMtu() const NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
 
   /** \brief Whether MTU can be overridden to the specified value
    *
@@ -196,7 +196,7 @@
   bool
   canOverrideMtuTo(ssize_t mtu) const;
 
-PROTECTED_WITH_TESTS_ELSE_PRIVATE: // send path
+NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE: // send path
   /** \brief request an IDLE packet to transmit pending service fields
    */
   void
@@ -208,13 +208,13 @@
   sendLpPacket(lp::Packet&& pkt);
 
   void
-  doSendInterest(const Interest& interest) OVERRIDE_WITH_TESTS_ELSE_FINAL;
+  doSendInterest(const Interest& interest) NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
 
   void
-  doSendData(const Data& data) OVERRIDE_WITH_TESTS_ELSE_FINAL;
+  doSendData(const Data& data) NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
 
   void
-  doSendNack(const ndn::lp::Nack& nack) OVERRIDE_WITH_TESTS_ELSE_FINAL;
+  doSendNack(const ndn::lp::Nack& nack) NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
 
   /** \brief assign consecutive sequence numbers to LpPackets
    */
@@ -245,7 +245,7 @@
 
 private: // receive path
   void
-  doReceivePacket(const Block& packet, const EndpointId& endpoint) OVERRIDE_WITH_TESTS_ELSE_FINAL;
+  doReceivePacket(const Block& packet, const EndpointId& endpoint) NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL;
 
   /** \brief decode incoming network-layer packet
    *  \param netPkt reassembled network-layer packet
@@ -297,14 +297,14 @@
   void
   decodeNack(const Block& netPkt, const lp::Packet& firstPkt, const EndpointId& endpointId);
 
-PROTECTED_WITH_TESTS_ELSE_PRIVATE:
+NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE:
   Options m_options;
   LpFragmenter m_fragmenter;
   LpReassembler m_reassembler;
   LpReliability m_reliability;
   lp::Sequence m_lastSeqNo;
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /// Time to mark next packet due to send queue congestion
   time::steady_clock::TimePoint m_nextMarkTime;
   /// number of marked packets in the current incident of congestion
diff --git a/daemon/face/lp-reliability.hpp b/daemon/face/lp-reliability.hpp
index 1ea2b9a..4349fca 100644
--- a/daemon/face/lp-reliability.hpp
+++ b/daemon/face/lp-reliability.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -105,12 +105,12 @@
   void
   piggyback(lp::Packet& pkt, ssize_t mtu);
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   class UnackedFrag;
   class NetPkt;
   using UnackedFrags = std::map<lp::Sequence, UnackedFrag>;
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /** \brief assign TxSequence number to a fragment
    *  \param frag fragment to assign TxSequence to
    *  \return assigned TxSequence number
@@ -162,7 +162,7 @@
   void
   deleteUnackedFrag(UnackedFrags::iterator fragIt);
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /** \brief contains a sent fragment that has not been acknowledged and associated data
    */
   class UnackedFrag
@@ -200,7 +200,7 @@
                                                   tlv::sizeOfVarNumber(sizeof(lp::Sequence)) +
                                                   sizeof(lp::Sequence);
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   Options m_options;
   GenericLinkService* m_linkService;
   UnackedFrags m_unackedFrags;
diff --git a/daemon/face/multicast-udp-transport.cpp b/daemon/face/multicast-udp-transport.cpp
index 0ea9687..ac66f36 100644
--- a/daemon/face/multicast-udp-transport.cpp
+++ b/daemon/face/multicast-udp-transport.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -150,7 +150,7 @@
   else {
     BOOST_ASSERT(localAddress.is_v6());
     sock.set_option(boost::asio::ip::v6_only(true));
-#ifdef WITH_TESTS
+#ifdef NFD_WITH_TESTS
     // To simplify unit tests, we bind to the "any" IPv6 address if the supplied multicast
     // address lacks a scope id. Calling bind() without a scope id would otherwise fail.
     if (multicastGroup.address().to_v6().scope_id() == 0)
diff --git a/daemon/face/netdev-bound.hpp b/daemon/face/netdev-bound.hpp
index 6297afd..be4a528 100644
--- a/daemon/face/netdev-bound.hpp
+++ b/daemon/face/netdev-bound.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -61,7 +61,7 @@
   processConfig(OptionalConfigSection configSection,
                 FaceSystem::ConfigContext& context);
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   struct Rule
   {
     std::vector<FaceUri> remotes;
@@ -71,7 +71,7 @@
   Rule
   parseRule(int index, const ConfigSection& confRule) const;
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   const FaceSystem& m_faceSystem;
   FaceCreatedCallback m_addFace;
   shared_ptr<ndn::net::NetworkMonitor> m_netmon;
diff --git a/daemon/face/network-predicate.hpp b/daemon/face/network-predicate.hpp
index 27ac8b1..7f77486 100644
--- a/daemon/face/network-predicate.hpp
+++ b/daemon/face/network-predicate.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -79,7 +79,7 @@
   void
   parseList(std::set<std::string>& set, std::initializer_list<std::pair<std::string, std::string>> list);
 
-PUBLIC_WITH_TESTS_ELSE_PROTECTED:
+NFD_PUBLIC_WITH_TESTS_ELSE_PROTECTED:
   std::set<std::string> m_whitelist;
   std::set<std::string> m_blacklist;
 };
diff --git a/daemon/face/null-transport.hpp b/daemon/face/null-transport.hpp
index dc4f3b8..1c81676 100644
--- a/daemon/face/null-transport.hpp
+++ b/daemon/face/null-transport.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -33,7 +33,7 @@
 
 /** \brief A Transport that drops every packet.
  */
-class NullTransport FINAL_UNLESS_WITH_TESTS : public Transport
+class NullTransport NFD_FINAL_UNLESS_WITH_TESTS : public Transport
 {
 public:
   explicit
@@ -44,14 +44,14 @@
 
 protected:
   void
-  doClose() OVERRIDE_WITH_TESTS_ELSE_FINAL
+  doClose() NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL
   {
     setState(TransportState::CLOSED);
   }
 
 private:
   void
-  doSend(const Block&) OVERRIDE_WITH_TESTS_ELSE_FINAL
+  doSend(const Block&) NFD_OVERRIDE_WITH_TESTS_ELSE_FINAL
   {
   }
 };
diff --git a/daemon/face/pcap-helper.hpp b/daemon/face/pcap-helper.hpp
index 5d239ce..1f08d85 100644
--- a/daemon/face/pcap-helper.hpp
+++ b/daemon/face/pcap-helper.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -28,7 +28,7 @@
 
 #include "core/common.hpp"
 
-#ifndef HAVE_LIBPCAP
+#ifndef NFD_HAVE_LIBPCAP
 #error "Cannot include this file when libpcap is not available"
 #endif
 
diff --git a/daemon/face/tcp-factory.hpp b/daemon/face/tcp-factory.hpp
index 0c22738..519d2dc 100644
--- a/daemon/face/tcp-factory.hpp
+++ b/daemon/face/tcp-factory.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -79,7 +79,7 @@
   bool m_wantCongestionMarking = false;
   std::map<tcp::Endpoint, shared_ptr<TcpChannel>> m_channels;
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   IpAddressPredicate m_local;
 };
 
diff --git a/daemon/face/tcp-transport.hpp b/daemon/face/tcp-transport.hpp
index a6a2048..c300eed 100644
--- a/daemon/face/tcp-transport.hpp
+++ b/daemon/face/tcp-transport.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -40,7 +40,7 @@
  * state is set to DOWN, and the connection is retried periodically with exponential backoff
  * until it is reestablished
  */
-class TcpTransport FINAL_UNLESS_WITH_TESTS : public StreamTransport<boost::asio::ip::tcp>
+class TcpTransport NFD_FINAL_UNLESS_WITH_TESTS : public StreamTransport<boost::asio::ip::tcp>
 {
 public:
   TcpTransport(protocol::socket&& socket, ndn::nfd::FacePersistency persistency, ndn::nfd::FaceScope faceScope);
@@ -61,17 +61,17 @@
   void
   handleError(const boost::system::error_code& error) final;
 
-PROTECTED_WITH_TESTS_ELSE_PRIVATE:
-  VIRTUAL_WITH_TESTS void
+NFD_PROTECTED_WITH_TESTS_ELSE_PRIVATE:
+  NFD_VIRTUAL_WITH_TESTS void
   reconnect();
 
-  VIRTUAL_WITH_TESTS void
+  NFD_VIRTUAL_WITH_TESTS void
   handleReconnect(const boost::system::error_code& error);
 
-  VIRTUAL_WITH_TESTS void
+  NFD_VIRTUAL_WITH_TESTS void
   handleReconnectTimeout();
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /** \brief how long to wait before the first reconnection attempt after the TCP connection has been severed
    */
   static time::milliseconds s_initialReconnectWait;
diff --git a/daemon/face/unix-stream-transport.hpp b/daemon/face/unix-stream-transport.hpp
index a52567a..1993143 100644
--- a/daemon/face/unix-stream-transport.hpp
+++ b/daemon/face/unix-stream-transport.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -28,7 +28,7 @@
 
 #include "stream-transport.hpp"
 
-#ifndef HAVE_UNIX_SOCKETS
+#ifndef NFD_HAVE_UNIX_SOCKETS
 #error "Cannot include this file when UNIX sockets are not available"
 #endif
 
diff --git a/daemon/face/websocket-channel.hpp b/daemon/face/websocket-channel.hpp
index c1b2805..1409289 100644
--- a/daemon/face/websocket-channel.hpp
+++ b/daemon/face/websocket-channel.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -74,7 +74,7 @@
   void
   listen(const FaceCreatedCallback& onFaceCreated);
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+NFD_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
   /** \pre listen hasn't been invoked
    */
   void
diff --git a/daemon/face/websocketpp.hpp b/daemon/face/websocketpp.hpp
index 022682b..4815ed1 100644
--- a/daemon/face/websocketpp.hpp
+++ b/daemon/face/websocketpp.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -26,9 +26,11 @@
 #ifndef NFD_DAEMON_FACE_WEBSOCKETPP_HPP
 #define NFD_DAEMON_FACE_WEBSOCKETPP_HPP
 
-#ifndef HAVE_WEBSOCKET
+#include "core/config.hpp"
+
+#ifndef NFD_HAVE_WEBSOCKET
 #error "Cannot include this file when WebSocket support is disabled"
-#endif // HAVE_WEBSOCKET
+#endif
 
 // suppress websocketpp warnings
 #pragma GCC system_header