Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
neoip_eloop + libevent: added sizeof(struct event) instead of hardcod…
…ed value (caused mac issue)

	modified:   src/neoip_eloop/fdwatch/levt/neoip_fdwatch_levt.hpp
	modified:   src/neoip_eloop/timeout/levt/neoip_timeout_levt.hpp
  • Loading branch information
jeromeetienne committed Aug 23, 2010
1 parent 52c4019 commit baedcd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/neoip_eloop/fdwatch/levt/neoip_fdwatch_levt.hpp
Expand Up @@ -9,6 +9,7 @@
/* system include */
#include <iostream>
#include <string>
#include <event.h>
/* local include */
#include "neoip_fdwatch_cb.hpp"
#include "neoip_fdwatch_cond.hpp"
Expand All @@ -20,9 +21,6 @@
# error "including a .hpp from a improper eloop implementation"
#endif

// forward declaration for libevent
struct event;

NEOIP_NAMESPACE_BEGIN;

/** \brief class definition for fdwatch_t
Expand All @@ -42,8 +40,8 @@ class fdwatch_t : NEOIP_COPY_CTOR_DENY {
bool external_is_started() const throw();
friend void external_neoip_fdwatch_levt_cb(int fd, short event, void *userptr);
struct event * external_ctx;
char external_ctx_buf[84]; // trick to avoid declaring struct event here and not
// have #include <event.h> which contains a lot of #define
char external_ctx_buf[sizeof(struct event)]; // trick to avoid declaring struct event here and not
// have #include <event.h> which contains a lot of #define
bool external_started;

/*************** callback stuff ***************************************/
Expand Down
5 changes: 3 additions & 2 deletions src/neoip_eloop/timeout/levt/neoip_timeout_levt.hpp
Expand Up @@ -8,6 +8,7 @@
#define __NEOIP_TIMEOUT_LEVT_HPP__
/* system include */
#include <string>
#include <event.h>
/* local include */
#include "neoip_timeout_wikidbg.hpp"
#include "neoip_timeout_cb.hpp"
Expand Down Expand Up @@ -50,8 +51,8 @@ class timeout_t : NEOIP_COPY_CTOR_DENY, private wikidbg_obj_t<timeout_t, timeout
bool external_is_started() const throw();
friend void external_callback(int fd, short event, void *userptr);
struct event * external_ctx;
char external_ctx_buf[84]; // trick to avoid declaring struct event here and not
// have #include <event.h> which contains a lot of #define
char external_ctx_buf[sizeof(struct event)]; // trick to avoid declaring struct event here and not
// have #include <event.h> which contains a lot of #define

/*************** callback stuff ***************************************/
timeout_cb_t * callback; //!< callback to notify timeout expiration
Expand Down

0 comments on commit baedcd7

Please sign in to comment.