mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 13:24:43 -04:00
Change all uses of WIN32 to _WIN32
This commit is contained in:
parent
20244671cd
commit
4e1439588f
@ -1,6 +1,6 @@
|
|||||||
#ifdef CHECK_FUNCTION_EXISTS
|
#ifdef CHECK_FUNCTION_EXISTS
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
char CHECK_FUNCTION_EXISTS();
|
char CHECK_FUNCTION_EXISTS();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ int main(){
|
|||||||
#else
|
#else
|
||||||
int main(int ac, char*av[]){
|
int main(int ac, char*av[]){
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
void * p = &CHECK_FUNCTION_EXISTS;
|
void * p = &CHECK_FUNCTION_EXISTS;
|
||||||
#else
|
#else
|
||||||
CHECK_FUNCTION_EXISTS();
|
CHECK_FUNCTION_EXISTS();
|
||||||
|
2
evutil.c
2
evutil.c
@ -1794,7 +1794,7 @@ evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)
|
|||||||
int r;
|
int r;
|
||||||
if (!buflen)
|
if (!buflen)
|
||||||
return 0;
|
return 0;
|
||||||
#if defined(_MSC_VER) || defined(WIN32)
|
#if defined(_MSC_VER) || defined(_WIN32)
|
||||||
r = _vsnprintf(buf, buflen, format, ap);
|
r = _vsnprintf(buf, buflen, format, ap);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
r = _vscprintf(format, ap);
|
r = _vscprintf(format, ap);
|
||||||
|
@ -171,7 +171,7 @@ main(int c, char **v) {
|
|||||||
++idx;
|
++idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
{
|
{
|
||||||
WSADATA WSAData;
|
WSADATA WSAData;
|
||||||
WSAStartup(0x101, &WSAData);
|
WSAStartup(0x101, &WSAData);
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ main(int argc, char **argv)
|
|||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
syntax();
|
syntax();
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
{
|
{
|
||||||
WORD wVersionRequested;
|
WORD wVersionRequested;
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
@ -210,7 +210,7 @@ main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif // _WIN32
|
||||||
|
|
||||||
url = argv[1];
|
url = argv[1];
|
||||||
http_uri = evhttp_uri_parse(url);
|
http_uri = evhttp_uri_parse(url);
|
||||||
@ -265,7 +265,7 @@ main(int argc, char **argv)
|
|||||||
if (!ssl_ctx)
|
if (!ssl_ctx)
|
||||||
die_openssl("SSL_CTX_new");
|
die_openssl("SSL_CTX_new");
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
/* TODO: Add certificate loading on Windows as well */
|
/* TODO: Add certificate loading on Windows as well */
|
||||||
|
|
||||||
/* Attempt to use the system's trusted root certificates.
|
/* Attempt to use the system's trusted root certificates.
|
||||||
@ -298,7 +298,7 @@ main(int argc, char **argv)
|
|||||||
* "wrapping" OpenSSL's routine, not replacing it. */
|
* "wrapping" OpenSSL's routine, not replacing it. */
|
||||||
SSL_CTX_set_cert_verify_callback (ssl_ctx, cert_verify_callback,
|
SSL_CTX_set_cert_verify_callback (ssl_ctx, cert_verify_callback,
|
||||||
(void *) host);
|
(void *) host);
|
||||||
#endif // not WIN32
|
#endif // not _WIN32
|
||||||
|
|
||||||
// Create event base
|
// Create event base
|
||||||
base = event_base_new();
|
base = event_base_new();
|
||||||
@ -359,7 +359,7 @@ main(int argc, char **argv)
|
|||||||
evhttp_connection_free(evcon);
|
evhttp_connection_free(evcon);
|
||||||
event_base_free(base);
|
event_base_free(base);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ main(int argc, char **argv)
|
|||||||
struct timeval *tv;
|
struct timeval *tv;
|
||||||
|
|
||||||
int num_pipes = 100;
|
int num_pipes = 100;
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
WSADATA WSAData;
|
WSADATA WSAData;
|
||||||
WSAStartup(0x101, &WSAData);
|
WSAStartup(0x101, &WSAData);
|
||||||
#endif
|
#endif
|
||||||
@ -180,7 +180,7 @@ main(int argc, char **argv)
|
|||||||
tv->tv_sec * 1000000L + tv->tv_usec);
|
tv->tv_sec * 1000000L + tv->tv_usec);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
event_base_dispatch(base);
|
event_base_dispatch(base);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user