Skip to content

Commit 35147d3

Browse files
author
Sebastiano Merlino
committed
Avoid inclusion of internal headers
1 parent 31c8124 commit 35147d3

File tree

9 files changed

+40
-2
lines changed

9 files changed

+40
-2
lines changed

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ PKG_CHECK_MODULES([LIBMICROHTTPD],[libmicrohttpd >= 0.9.7],[],[AC_MSG_ERROR("lib
7272
#AC_CHECK_HEADER([microhttpd.h],[],[AC_MSG_ERROR("Microhttpd header files not found. Please use a version >= 0.9.9.")])
7373
#AC_CHECK_LIB([microhttpd],[MHD_start_daemon],[],[AC_MSG_ERROR("Microhttpd header files not found. Please use a version >= 0.9.9.")])
7474

75+
CXXFLAGS="-DHTTPSERVER_COMPILATION $CXXFLAGS"
76+
7577
CXXFLAGS="$LIBMICROHTTPD_CFLAGS $CXXFLAGS"
7678
LDFLAGS="$LIBMICROHTTPD_LIBS $LD_FLAGS"
7779

src/httpserver.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
#ifndef _httpserver_hpp_
2-
#define _httpserver_hpp_
1+
#ifndef _HTTPSERVER_HPP_
2+
#define _HTTPSERVER_HPP_
3+
4+
#define _HTTPSERVER_HPP_INSIDE_
35

46
#ifdef SWIG
57
%include "std_string.i"

src/httpserver/http_endpoint.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
1919
*/
20+
21+
#if !defined (_HTTPSERVER_HPP_INSIDE_) && !defined (HTTPSERVER_COMPILATION)
22+
#error "Only <httpserver.hpp> or <httpserverpp> can be included directly."
23+
#endif
24+
2025
#ifndef _HTTP_ENDPOINT_HPP_
2126
#define _HTTP_ENDPOINT_HPP_
2227

src/httpserver/http_request.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
1919
*/
20+
21+
#if !defined (_HTTPSERVER_HPP_INSIDE_) && !defined (HTTPSERVER_COMPILATION)
22+
#error "Only <httpserver.hpp> or <httpserverpp> can be included directly."
23+
#endif
24+
2025
#ifndef _HTTP_REQUEST_HPP_
2126
#define _HTTP_REQUEST_HPP_
2227

src/httpserver/http_resource.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
1919
*/
20+
21+
#if !defined (_HTTPSERVER_HPP_INSIDE_) && !defined (HTTPSERVER_COMPILATION)
22+
#error "Only <httpserver.hpp> or <httpserverpp> can be included directly."
23+
#endif
24+
2025
#ifndef _http_resource_hpp_
2126
#define _http_resource_hpp_
2227
#include <map>

src/httpserver/http_response.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
1919
*/
20+
21+
#if !defined (_HTTPSERVER_HPP_INSIDE_) && !defined (HTTPSERVER_COMPILATION)
22+
#error "Only <httpserver.hpp> or <httpserverpp> can be included directly."
23+
#endif
24+
2025
#ifndef _HTTP_RESPONSE_HPP_
2126
#define _HTTP_RESPONSE_HPP_
2227
#include <map>

src/httpserver/http_utils.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
1919
*/
2020

21+
#if !defined (_HTTPSERVER_HPP_INSIDE_) && !defined (HTTPSERVER_COMPILATION)
22+
#error "Only <httpserver.hpp> or <httpserverpp> can be included directly."
23+
#endif
24+
2125
#ifndef _HTTPUTILS_H_
2226
#define _HTTPUTILS_H_
2327

src/httpserver/string_utilities.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
1919
*/
20+
21+
#if !defined (_HTTPSERVER_HPP_INSIDE_) && !defined (HTTPSERVER_COMPILATION)
22+
#error "Only <httpserver.hpp> or <httpserverpp> can be included directly."
23+
#endif
24+
2025
#ifndef _STRING_UTILITIES_H_
2126
#define _STRING_UTILITIES_H_
2227

src/httpserver/webserver.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
1919
*/
20+
21+
#if !defined (_HTTPSERVER_HPP_INSIDE_) && !defined (HTTPSERVER_COMPILATION)
22+
#error "Only <httpserver.hpp> or <httpserverpp> can be included directly."
23+
#endif
24+
2025
#ifndef _FRAMEWORK_WEBSERVER_HPP_
2126
#define _FRAMEWORK_WEBSERVER_HPP_
2227

0 commit comments

Comments
 (0)