Skip to content

Commit e40716d

Browse files
committed
Fixes/changes for OS/X compilation
Added various include directives in http_response.cpp and http_resource.cpp and modified http_endpoint copy constructor to make it public to satifify clang. Fixed typo/bug in http_request::set_requestor_port. Modified various forwards to match actual declarations. Modified configure to allow build in same directory.
1 parent 3696904 commit e40716d

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

configure.ac

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ CXXFLAGS=$OLD_CXXFLAGS
3939
AC_LANG([C++])
4040
AC_SYS_LARGEFILE
4141

42-
if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
43-
AC_MSG_ERROR("you must configure in a separate build directory")
44-
fi
45-
4642
# Checks for header files.
4743
AC_HEADER_STDC
4844
AC_CHECK_HEADER([string],[],[AC_MSG_ERROR("C++ strings not found")])

src/http_resource.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
1919
*/
20+
21+
#include <stdlib.h>
22+
2023
#include "http_resource.hpp"
2124
#include "http_utils.hpp"
2225
#include "http_request.hpp"
2326
#include "http_response.hpp"
27+
#include "details/event_tuple.hpp"
2428
#include "webserver.hpp"
2529
#include "string_utilities.hpp"
2630

src/http_response.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@
2525
#include <fcntl.h>
2626
#include <unistd.h>
2727
#include "http_utils.hpp"
28+
#include "details/http_resource_mirror.hpp"
29+
#include "details/event_tuple.hpp"
2830
#include "webserver.hpp"
2931
#include "http_response.hpp"
3032

33+
3134
using namespace std;
3235

3336
namespace httpserver

src/httpserver/details/http_endpoint.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class webserver;
3838
namespace details
3939
{
4040

41-
struct http_resource_mirror;
41+
class http_resource_mirror;
4242

4343
/**
4444
* Exception class throwed when a bad formatted http url is used
@@ -60,7 +60,7 @@ class bad_http_endpoint : public std::exception
6060
**/
6161
class http_endpoint
6262
{
63-
private:
63+
public:
6464
/**
6565
* Copy constructor. It is useful expecially to copy regex_t structure that contains dinamically allocated data.
6666
* @param h The http_endpoint to copy
@@ -75,6 +75,7 @@ class http_endpoint
7575
* @param b The http_endpoint to compare to
7676
* @return boolean indicating if this is less than b.
7777
**/
78+
private:
7879
bool operator <(const http_endpoint& b) const;
7980
/**
8081
* Operator overload for "assignment operator". It is used to copy endpoints to existing objects.

src/httpserver/http_request.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ class http_request
509509
* Method used to set the requestor port
510510
* @param requestor The requestor port to set
511511
**/
512-
void set_requestor_port(short requestor)
512+
void set_requestor_port(short requestor_port)
513513
{
514514
this->requestor_port = requestor_port;
515515
}

src/httpserver/webserver.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ struct httpserver_ska;
6060
};
6161

6262
namespace details {
63+
class http_endpoint;
6364
class http_resource_mirror;
6465
class event_tuple;
65-
class http_endpoint;
66-
class daemon_item;
67-
class modded_request;
66+
struct daemon_item;
67+
struct modded_request;
6868
struct cache_entry;
6969
}
7070

0 commit comments

Comments
 (0)