[vlc-commits] upnp: fix headers

Shaleen Jain git at videolan.org
Sun Oct 28 11:26:20 CET 2018


vlc | branch: master | Shaleen Jain <shaleen at jain.sh> | Tue Oct 23 12:39:18 2018 +0530| [92f2a45aabe28874623a9f8ccadc3e501cb5bff9] | committer: Jean-Baptiste Kempf

upnp: fix headers

Header files should be self-contained and should not have
to adhere to special conditions or include order to include the header.
Also add a header guard

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=92f2a45aabe28874623a9f8ccadc3e501cb5bff9
---

 modules/services_discovery/upnp-wrapper.cpp | 2 --
 modules/services_discovery/upnp-wrapper.hpp | 5 +++++
 modules/services_discovery/upnp.cpp         | 4 ----
 modules/services_discovery/upnp.hpp         | 1 +
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/services_discovery/upnp-wrapper.cpp b/modules/services_discovery/upnp-wrapper.cpp
index 52c942cb3d..6ff748c8b4 100644
--- a/modules/services_discovery/upnp-wrapper.cpp
+++ b/modules/services_discovery/upnp-wrapper.cpp
@@ -28,8 +28,6 @@
 # include "config.h"
 #endif
 
-#include <vlc_common.h>
-
 #ifdef _WIN32
 #include <windows.h>
 #include <wincrypt.h>
diff --git a/modules/services_discovery/upnp-wrapper.hpp b/modules/services_discovery/upnp-wrapper.hpp
index c62749214e..f19031d864 100644
--- a/modules/services_discovery/upnp-wrapper.hpp
+++ b/modules/services_discovery/upnp-wrapper.hpp
@@ -24,6 +24,10 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#ifndef UPNP_WRAPPER_H
+#define UPNP_WRAPPER_H
+
+#include <vlc_common.h>
 #include <vlc_charset.h>
 
 #include <memory>
@@ -342,3 +346,4 @@ inline char *getIpv4ForMulticast()
 #endif
 
 #endif /* _WIN32 */
+#endif /* UPNP_WRAPPER_H */
diff --git a/modules/services_discovery/upnp.cpp b/modules/services_discovery/upnp.cpp
index a4c6ba5479..885c40d5df 100644
--- a/modules/services_discovery/upnp.cpp
+++ b/modules/services_discovery/upnp.cpp
@@ -28,10 +28,6 @@
 # include "config.h"
 #endif
 
-#include <vlc_common.h>
-#include <vlc_threads.h>
-#include <vlc_cxx_helpers.hpp>
-
 #include "upnp.hpp"
 
 #include <vlc_access.h>
diff --git a/modules/services_discovery/upnp.hpp b/modules/services_discovery/upnp.hpp
index f62e43af0a..8b6f947b9e 100644
--- a/modules/services_discovery/upnp.hpp
+++ b/modules/services_discovery/upnp.hpp
@@ -37,6 +37,7 @@
 #include <vlc_url.h>
 #include <vlc_interrupt.h>
 #include <vlc_threads.h>
+#include <vlc_cxx_helpers.hpp>
 
 namespace SD
 {



More information about the vlc-commits mailing list