Permalink
Browse files

Use "_WIN32", not WIN32: it's standard and we don't need to fake it

This patch was automatically generated with perl.

Based on a patch by Peter Rosin.
  • Loading branch information...
1 parent 0e95950 commit 9f560bfa114b8216af2dac28966eae53c0c97ed3 Nick Mathewson committed May 25, 2011
Showing with 237 additions and 237 deletions.
  1. +5 −5 arc4random.c
  2. +12 −12 buffer.c
  3. +1 −1 bufferevent-internal.h
  4. +1 −1 bufferevent.c
  5. +1 −1 bufferevent_async.c
  6. +1 −1 bufferevent_filter.c
  7. +1 −1 bufferevent_openssl.c
  8. +1 −1 bufferevent_pair.c
  9. +6 −6 bufferevent_sock.c
  10. +1 −1 compat/sys/queue.h
  11. +4 −4 evbuffer-internal.h
  12. +5 −5 evdns.c
  13. +2 −2 event-internal.h
  14. +12 −12 event.c
  15. +1 −1 event.h
  16. +1 −1 event_iocp.c
  17. +2 −2 event_tagging.c
  18. +3 −3 evmap.c
  19. +3 −3 evrpc.c
  20. +1 −1 evthread-internal.h
  21. +1 −1 evthread_win32.c
  22. +19 −19 evutil.c
  23. +6 −6 http.c
  24. +1 −1 include/event2/dns.h
  25. +1 −1 include/event2/dns_compat.h
  26. +1 −1 include/event2/rpc.h
  27. +1 −1 include/event2/thread.h
  28. +8 −8 include/event2/util.h
  29. +1 −1 iocp-internal.h
  30. +6 −6 listener.c
  31. +1 −1 log.c
  32. +2 −2 sample/dns-example.c
  33. +6 −6 sample/event-test.c
  34. +2 −2 sample/hello-world.c
  35. +8 −8 sample/http-server.c
  36. +1 −1 sample/le-proxy.c
  37. +2 −2 sample/signal-test.c
  38. +3 −3 sample/time-test.c
  39. +5 −5 signal.c
  40. +4 −4 test/bench.c
  41. +3 −3 test/bench_cascade.c
  42. +3 −3 test/bench_http.c
  43. +2 −2 test/bench_httpclient.c
  44. +10 −10 test/regress.c
  45. +2 −2 test/regress_buffer.c
  46. +4 −4 test/regress_bufferevent.c
  47. +2 −2 test/regress_dns.c
  48. +3 −3 test/regress_et.c
  49. +4 −4 test/regress_http.c
  50. +3 −3 test/regress_listener.c
  51. +9 −9 test/regress_main.c
  52. +2 −2 test/regress_rpc.c
  53. +2 −2 test/regress_ssl.c
  54. +2 −2 test/regress_testutils.c
  55. +5 −5 test/regress_thread.c
  56. +7 −7 test/regress_util.c
  57. +2 −2 test/regress_zlib.c
  58. +7 −7 test/test-changelist.c
  59. +2 −2 test/test-eof.c
  60. +2 −2 test/test-init.c
  61. +5 −5 test/test-ratelim.c
  62. +3 −3 test/test-time.c
  63. +3 −3 test/test-weof.c
  64. +4 −4 test/tinytest.c
  65. +1 −1 test/tinytest_local.h
  66. +2 −2 util-internal.h
View
@@ -50,7 +50,7 @@
#ifndef ARC4RANDOM_NO_INCLUDES
#include "evconfig-private.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <wincrypt.h>
#include <process.h>
#else
@@ -79,7 +79,7 @@ struct arc4_stream {
unsigned char s[256];
};
-#ifdef WIN32
+#ifdef _WIN32
#define getpid _getpid
#define pid_t int
#endif
@@ -120,7 +120,7 @@ arc4_addrandom(const unsigned char *dat, int datlen)
rs.j = rs.i;
}
-#ifndef WIN32
+#ifndef _WIN32
static ssize_t
read_all(int fd, unsigned char *buf, size_t count)
{
@@ -140,7 +140,7 @@ read_all(int fd, unsigned char *buf, size_t count)
}
#endif
-#ifdef WIN32
+#ifdef _WIN32
#define TRY_SEED_WIN32
static int
arc4_seed_win32(void)
@@ -290,7 +290,7 @@ arc4_seed_proc_sys_kernel_random_uuid(void)
}
#endif
-#ifndef WIN32
+#ifndef _WIN32
#define TRY_SEED_URANDOM
static int
arc4_seed_urandom(void)
View
@@ -28,7 +28,7 @@
#include "event2/event-config.h"
#include "evconfig-private.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#include <io.h>
@@ -194,7 +194,7 @@ evbuffer_chain_free(struct evbuffer_chain *chain)
struct evbuffer_chain_file_segment,
chain);
if (info->segment) {
-#ifdef WIN32
+#ifdef _WIN32
if (info->segment->type == EVBUF_FS_MMAP)
UnmapViewOfFile(chain->buffer);
#endif
@@ -1873,7 +1873,7 @@ evbuffer_expand(struct evbuffer *buf, size_t datlen)
* Reads data from a file descriptor into a buffer.
*/
-#if defined(_EVENT_HAVE_SYS_UIO_H) || defined(WIN32)
+#if defined(_EVENT_HAVE_SYS_UIO_H) || defined(_WIN32)
#define USE_IOVEC_IMPL
#endif
@@ -1961,7 +1961,7 @@ _evbuffer_read_setup_vecs(struct evbuffer *buf, ev_ssize_t howmuch,
static int
get_n_bytes_readable_on_socket(evutil_socket_t fd)
{
-#if defined(FIONREAD) && defined(WIN32)
+#if defined(FIONREAD) && defined(_WIN32)
unsigned long lng = EVBUFFER_MAX_READ;
if (ioctlsocket(fd, FIONREAD, &lng) < 0)
return -1;
@@ -2027,7 +2027,7 @@ evbuffer_read(struct evbuffer *buf, evutil_socket_t fd, int howmuch)
WSABUF_FROM_EVBUFFER_IOV(&vecs[i], &ev_vecs[i]);
#endif
-#ifdef WIN32
+#ifdef _WIN32
{
DWORD bytesRead;
DWORD flags=0;
@@ -2058,7 +2058,7 @@ evbuffer_read(struct evbuffer *buf, evutil_socket_t fd, int howmuch)
/* We can append new data at this point */
p = chain->buffer + chain->misalign + chain->off;
-#ifndef WIN32
+#ifndef _WIN32
n = read(fd, p, howmuch);
#else
n = recv(fd, p, howmuch, 0);
@@ -2137,7 +2137,7 @@ evbuffer_write_iovec(struct evbuffer *buffer, evutil_socket_t fd,
}
chain = chain->next;
}
-#ifdef WIN32
+#ifdef _WIN32
{
DWORD bytesSent;
if (WSASend(fd, iov, i, &bytesSent, 0, NULL, NULL))
@@ -2227,7 +2227,7 @@ evbuffer_write_atmost(struct evbuffer *buffer, evutil_socket_t fd,
#endif
#ifdef USE_IOVEC_IMPL
n = evbuffer_write_iovec(buffer, fd, howmuch);
-#elif defined(WIN32)
+#elif defined(_WIN32)
/* XXX(nickm) Don't disable this code until we know if
* the WSARecv code above works. */
void *p = evbuffer_pullup(buffer, howmuch);
@@ -2600,7 +2600,7 @@ evbuffer_file_segment_new(
seg->fd = fd;
seg->flags = flags;
-#ifdef WIN32
+#ifdef _WIN32
#define lseek _lseeki64
#define fstat _fstat
#define stat _stat
@@ -2661,7 +2661,7 @@ evbuffer_file_segment_new(
}
}
#endif
-#ifdef WIN32
+#ifdef _WIN32
if (!(flags & EVBUF_FS_DISABLE_MMAP)) {
long h = (long)_get_osfhandle(fd);
HANDLE m;
@@ -2742,7 +2742,7 @@ evbuffer_file_segment_free(struct evbuffer_file_segment *seg)
if (seg->type == EVBUF_FS_SENDFILE) {
;
} else if (seg->type == EVBUF_FS_MMAP) {
-#ifdef WIN32
+#ifdef _WIN32
CloseHandle(seg->mapping_handle);
#elif defined (_EVENT_HAVE_MMAP)
if (munmap(seg->mapping, seg->length) == -1)
@@ -2799,7 +2799,7 @@ evbuffer_add_file_segment(struct evbuffer *buf,
chain->off = length;
chain->buffer_len = chain->misalign + length;
} else if (seg->type == EVBUF_FS_MMAP) {
-#ifdef WIN32
+#ifdef _WIN32
ev_uint64_t total_offset = seg->offset+offset;
ev_uint64_t offset_rounded=0, offset_remaining=0;
LPVOID data;
View
@@ -260,7 +260,7 @@ extern const struct bufferevent_ops bufferevent_ops_pair;
#define BEV_IS_FILTER(bevp) ((bevp)->be_ops == &bufferevent_ops_filter)
#define BEV_IS_PAIR(bevp) ((bevp)->be_ops == &bufferevent_ops_pair)
-#ifdef WIN32
+#ifdef _WIN32
extern const struct bufferevent_ops bufferevent_ops_async;
#define BEV_IS_ASYNC(bevp) ((bevp)->be_ops == &bufferevent_ops_async)
#else
View
@@ -42,7 +42,7 @@
#include <stdarg.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#endif
#include <errno.h>
View
@@ -44,7 +44,7 @@
#include <unistd.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
View
@@ -44,7 +44,7 @@
#include <stdarg.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#endif
View
@@ -44,7 +44,7 @@
#include <unistd.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#endif
View
@@ -28,7 +28,7 @@
#include <sys/types.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#endif
View
@@ -46,7 +46,7 @@
#include <unistd.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
@@ -71,7 +71,7 @@
#include "mm-internal.h"
#include "bufferevent-internal.h"
#include "util-internal.h"
-#ifdef WIN32
+#ifdef _WIN32
#include "iocp-internal.h"
#endif
@@ -232,7 +232,7 @@ bufferevent_writecb(evutil_socket_t fd, short event, void *arg)
goto done;
} else {
connected = 1;
-#ifdef WIN32
+#ifdef _WIN32
if (BEV_IS_ASYNC(bufev)) {
event_del(&bufev->ev_write);
bufferevent_async_set_connected(bufev);
@@ -314,7 +314,7 @@ bufferevent_socket_new(struct event_base *base, evutil_socket_t fd,
struct bufferevent_private *bufev_p;
struct bufferevent *bufev;
-#ifdef WIN32
+#ifdef _WIN32
if (base && event_base_get_iocp(base))
return bufferevent_async_new(base, fd, options);
#endif
@@ -371,7 +371,7 @@ bufferevent_socket_connect(struct bufferevent *bev,
ownfd = 1;
}
if (sa) {
-#ifdef WIN32
+#ifdef _WIN32
if (bufferevent_async_can_connect(bev)) {
bufferevent_setfd(bev, fd);
r = bufferevent_async_connect(bev, fd, sa, socklen);
@@ -386,7 +386,7 @@ bufferevent_socket_connect(struct bufferevent *bev,
if (r < 0)
goto freesock;
}
-#ifdef WIN32
+#ifdef _WIN32
/* ConnectEx() isn't always around, even when IOCP is enabled.
* Here, we borrow the socket object's write handler to fall back
* on a non-blocking connect() when ConnectEx() is unavailable. */
View
@@ -93,7 +93,7 @@ struct name { \
#define SLIST_HEAD_INITIALIZER(head) \
{ NULL }
-#ifndef WIN32
+#ifndef _WIN32
#define SLIST_ENTRY(type) \
struct { \
struct type *sle_next; /* next element */ \
View
@@ -42,7 +42,7 @@ extern "C" {
* arguments. */
#define EVBUFFER_CB_NODEFER 2
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#endif
#include <sys/queue.h>
@@ -126,7 +126,7 @@ struct evbuffer {
* overflows when we have mutually recursive callbacks, and for
* serializing callbacks in a single thread. */
unsigned deferred_cbs : 1;
-#ifdef WIN32
+#ifdef _WIN32
/** True iff this buffer is set up for overlapped IO. */
unsigned is_overlapped : 1;
#endif
@@ -205,7 +205,7 @@ struct evbuffer_chain_reference {
* evbuffer_chain with the EVBUFFER_FILESEGMENT flag set. */
struct evbuffer_chain_file_segment {
struct evbuffer_file_segment *segment;
-#ifdef WIN32
+#ifdef _WIN32
/** If we're using CreateFileMapping, this is the handle to the view. */
HANDLE view_handle;
#endif
@@ -224,7 +224,7 @@ struct evbuffer_file_segment {
int fd;
/** If we're using mmap, this is the raw mapped memory. */
void *mapping;
-#ifdef WIN32
+#ifdef _WIN32
/** If we're using CreateFileMapping, this is the mapping */
HANDLE mapping_handle;
#endif
View
10 evdns.c
@@ -61,7 +61,7 @@
#include <sys/stat.h>
#include <stdio.h>
#include <stdarg.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#ifndef _WIN32_IE
@@ -89,7 +89,7 @@
#include "ipv6-internal.h"
#include "util-internal.h"
#include "evthread-internal.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <ctype.h>
#include <winsock2.h>
#include <windows.h>
@@ -3437,7 +3437,7 @@ evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *con
static char *
evdns_get_default_hosts_filename(void)
{
-#ifdef WIN32
+#ifdef _WIN32
/* Windows is a little coy about where it puts its configuration
* files. Sure, they're _usually_ in C:\windows\system32, but
* there's no reason in principle they couldn't be in
@@ -3519,7 +3519,7 @@ evdns_resolv_conf_parse(int flags, const char *const filename) {
}
-#ifdef WIN32
+#ifdef _WIN32
/* Add multiple nameservers from a space-or-comma-separated list. */
static int
evdns_nameserver_ip_add_line(struct evdns_base *base, const char *ips) {
@@ -3799,7 +3799,7 @@ evdns_base_new(struct event_base *event_base, int initialize_nameservers)
if (initialize_nameservers) {
int r;
-#ifdef WIN32
+#ifdef _WIN32
r = evdns_base_config_windows_nameservers(base);
#else
r = evdns_base_resolv_conf_parse(base, DNS_OPTIONS_ALL, "/etc/resolv.conf");
View
@@ -101,7 +101,7 @@ struct eventop {
size_t fdinfo_len;
};
-#ifdef WIN32
+#ifdef _WIN32
/* If we're on win32, then file descriptors are not nice low densely packed
integers. Instead, they are pointer-like windows handles, and we want to
use a hashtable instead of an array to map fds to events.
@@ -265,7 +265,7 @@ struct event_base {
int current_event_waiters;
#endif
-#ifdef WIN32
+#ifdef _WIN32
/** IOCP support structure, if IOCP is enabled. */
struct event_iocp_port *iocp;
#endif
Oops, something went wrong.

0 comments on commit 9f560bf

Please sign in to comment.