[Libevent-users] patch for building libevent with vs2008

Nick Mathewson nickm at freehaven.net
Sat Jun 14 13:50:47 EDT 2008


On Thu, Jun 12, 2008 at 11:00:28PM +0800, liusifan wrote:
> Hi, all
> 
> Libevent svn main trunk cannot build with vs2008.
> 
> The patch is in attachment. 
> Changes: Rename INPUT to EVRPC_INPUT and OUTPUT to EVRPC_INPUT

Hi!  This patch has the same problem as the last three patches that
did this: it doesn't keep backward compatibility with existing code
that uses the old names.  We try very hard not to change source APIs
in ways that will break correct code that worked before.

Instead, I'd suggest changing

  enum EVRPC_HOOK_TYPE { INPUT, OUTPUT };

to

  enum EVRPC_HOOK_TYPE { EVRPC_INPUT, EVRPC_OUTPUT };
  #ifndef WIN32
  #define INPUT EVRPC_INPUT
  #define OUTPUT EVRPC_INPUT
  #endif

I've checked in a fix that does this; please let me know if it has
problems.

yrs,
-- 
Nick


More information about the Libevent-users mailing list