#include <stdio.h>
#include <string.h>
#include <stdbool.h>
+#include <stdlib.h>
+
+
+#ifdef __MINGW32__
+#include <windows.h>
+#include <winsock.h>
+#endif
#ifdef SSL_SUPPORT
#include <openssl/ssl.h>
return 1;
}
#endif
+#ifdef __MINGW32__
+ WSADATA wsa;
+ WSAStartup(MAKEWORD(2, 2), &wsa);
+#endif
#ifdef SSL_SUPPORT
__W3_Debug("LibW3", "This is LibW3, version " LIBW3_VERSION ", using " OPENSSL_VERSION_TEXT);
#else
#include <stdlib.h>
#include <string.h>
+
+#ifdef __MINGW32__
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <windows.h>
+#else
#include <sys/socket.h>
#include <netdb.h>
+#endif
+
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
#include <openssl/ssl.h>
#endif
+#ifndef __MINGW32__
+#define ADDRINFO struct addrinfo
+#endif
+
int __W3_DNS_Connect(const char* hostname, bool ssl, uint16_t port
#ifdef SSL_SUPPORT
,
#endif
){
__W3_Debug("DNS-Connect", "Resolving");
- struct addrinfo hints;
- struct addrinfo* result;
- struct addrinfo* rp;
+ ADDRINFO hints;
+ ADDRINFO* result;
+ ADDRINFO* rp;
int s;
memset(&hints, 0, sizeof(hints));
#include <string.h>
#include <stdlib.h>
+#ifdef __MINGW32__
+#include <windows.h>
+#include <winsock.h>
+#else
+#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#endif
+
#define __DEBUG_LEN 12
void __W3_Debug(const char* title, const char* message){
LIBS += -lssl -lcrypto
endif
+ifdef WINDOWS
+LIBS += -lws2_32
+endif
+
ifdef DEBUG
CFLAGS += -g -D__DEBUG__
endif
-SSL=YES
+#SSL=YES
DEBUG=YES