]> granicus.if.org Git - libevent/commitdiff
Reduce windows header includes in our own headers.
authorNick Mathewson <nickm@torproject.org>
Wed, 3 Feb 2010 07:09:19 +0000 (02:09 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 3 Feb 2010 07:09:19 +0000 (02:09 -0500)
It turns out that absolutely everything that was including
windows.h was doing so needlessly; our headers don't need it,
so we should just include winsock2.h (since that's where
struct timeval is defined).

Pre-2.0 code will use the old headers, which include windows.h
for them, so we aren't breaking source compatibility with 1.4.

This solves the bug where we were leaving WIN32_LEAN_AND_MEAN
defined, in roughly the same way that buying an automobile
solves the question of what to give your coachman for boxing
day.

evdns.c
include/event2/bufferevent.h
include/event2/bufferevent_struct.h
include/event2/event.h
include/event2/event_compat.h
include/event2/event_struct.h
include/event2/http.h
include/event2/http_compat.h
include/event2/tag.h
include/event2/util.h

diff --git a/evdns.c b/evdns.c
index 6afe75576cee2864c77fbfdb2eca488675fc35c8..3611bc63941c64977920448f8b8c54778f70959c 100644 (file)
--- a/evdns.c
+++ b/evdns.c
 #ifdef WIN32
 #include <winsock2.h>
 #include <ws2tcpip.h>
+#ifndef _WIN32_IE
 #define _WIN32_IE 0x400
+#endif
 #include <shlobj.h>
 #endif
 
index 5ca707fa04a2e35fc394317250e1db16d69cdb37..795607b0f0715ef22f51c699fcdd1191f04e9706 100644 (file)
@@ -65,13 +65,6 @@ extern "C" {
 /* For int types. */
 #include <event2/util.h>
 
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
-
 /* Just for error reporting - use other constants otherwise */
 #define BEV_EVENT_READING      0x01    /**< error encountered while reading */
 #define BEV_EVENT_WRITING      0x02    /**< error encountered while writing */
index 4498631507ad6aae0232eaa4255de59be6133612..3eef9f2f5b1a439b033b6097dc3fcf14450c3358 100644 (file)
@@ -51,12 +51,6 @@ extern "C" {
 /* For struct event */
 #include <event2/event_struct.h>
 
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
 struct event_watermark {
        size_t low;
        size_t high;
index d2153e1b6bd7bab22733b37e6abfec0da915b894..2a57a6baedcbf8f2e5fe36375698e18303ff4992 100644 (file)
@@ -50,12 +50,6 @@ extern "C" {
 /* For int types. */
 #include <event2/util.h>
 
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
 struct event_base;
 struct event;
 struct event_config;
index eacb1cab7d6acaba51180f1abfc47d1a2f7f3e21..2356aa04a1573a3a834498acf3a71f81b4d7aeb0 100644 (file)
@@ -49,12 +49,6 @@ extern "C" {
 /* For int types. */
 #include <event2/util.h>
 
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
 /**
   Initialize the event API.
 
index 02b0669128b2e8b2020c4bedac84116c440e2949..b8e438ccd65e6182cb2ebc89939134d591565a75 100644 (file)
@@ -49,13 +49,6 @@ extern "C" {
 /* For int types. */
 #include <event2/util.h>
 
-#ifdef WIN32
-#include <winsock2.h>
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
 #define EVLIST_TIMEOUT 0x01
 #define EVLIST_INSERTED        0x02
 #define EVLIST_SIGNAL  0x04
index 0edaf7e7dfd2c1269c5db03f5068a038769a4c4e..d5dff821aec8b017321f41ad60e70ff414a3975c 100644 (file)
 extern "C" {
 #endif
 
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <winsock2.h>
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
 /* In case we haven't included the right headers yet. */
 struct evbuffer;
 struct event_base;
index 8f2b8082016617c055119150d8bc949fb552a3f6..c8f048b5b531beefbf7d7247b1c6d27460e6b51d 100644 (file)
@@ -49,12 +49,6 @@ extern "C" {
 /* For int types. */
 #include <event2/util.h>
 
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
 /**
  * Start an HTTP server on the specified address and port
  *
index ebed1a61ca3771d867cb47201c12655d2a78b6c2..67687ee9adbfed6c2603cb688f3fb6c8317f3038 100644 (file)
@@ -48,12 +48,6 @@ extern "C" {
 /* For int types. */
 #include <event2/util.h>
 
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
 struct evbuffer;
 
 /*
index 12817802a1209c6defc665076deeded776a15f1a..c14783e7c28172dfb20902d6b4085596ac5099a6 100644 (file)
@@ -63,6 +63,10 @@ extern "C" {
 #include <netdb.h>
 #endif
 
+#ifdef WIN32
+#include <winsock2.h>
+#endif
+
 /* Integer type definitions for types that are supposed to be defined in the
  * C99-specified stdint.h.  Shamefully, some platforms do not include
  * stdint.h, so we need to replace it.  (If you are on a platform like this,