]> Git repositories of Nishi - tewi.git/commitdiff
add an option to disable getaddrinfo
authorNishi <nishi@nishi.boats>
Thu, 26 Sep 2024 00:33:22 +0000 (00:33 +0000)
committerNishi <nishi@nishi.boats>
Thu, 26 Sep 2024 00:33:22 +0000 (00:33 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@163 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/server.c
Server/tw_version.h
Server/version.c
config.h.tmpl

index dea62ec24bb6b28c964698299d2d55793b35eb2f..8c7ea203b617ea002edeacc3aa7120effbe73f63 100644 (file)
 #include <cm_dir.h>
 
 #ifdef __MINGW32__
+#ifndef NO_GETADDRINFO
 #include <ws2tcpip.h>
 #include <wspiapi.h>
+#endif
 #include <winsock2.h>
 #include <process.h>
 #include <windows.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
+#ifndef NO_GETADDRINFO
 #include <netdb.h>
 #endif
+#endif
 
 #ifdef __HAIKU__
 #include <OS.h>
@@ -448,8 +452,10 @@ int32_t tw_server_pass(void* ptr) {
 
        char address[513];
        address[0] = 0;
+#ifndef NO_GETADDRINFO
        struct sockaddr* sa = (struct sockaddr*)&addr;
        getnameinfo(sa, sizeof(addr), address, 512, NULL, 0, NI_NUMERICHOST);
+#endif
 
        struct tw_http_request req;
        struct tw_http_response res;
index ed6becdc603c0edd48e43e2a7b8da95cb6b83ea2..05640c35cb47d8e0847fd24b212608e5ae1bf0fa 100644 (file)
@@ -7,7 +7,7 @@
 extern "C" {
 #endif
 
-#define TW_VERSION "1.08\0"
+#define TW_VERSION "1.08A\0"
 
 const char* tw_get_version(void);
 const char* tw_get_platform(void);
index bd2514d7476bbb373fcc4ba052e6e798143c0f91..c4cbb4ccc25519bcf954a65d5a43b9678418b3f0 100644 (file)
@@ -17,6 +17,8 @@ const char* tw_platform =
     "Windows"
 #elif defined(__HAIKU__)
     "Haiku"
+#elif defined(__CYGWIN__)
+    "Cygwin"
 #else
     "Unix"
 #endif
index 7666cd01a10b7d3876ae906e20183a71fec145de..7b18bff825254a96412740a2eabdfe5199cd7ff1 100644 (file)
@@ -8,6 +8,7 @@
 #undef NO_SSL
 #define USE_POLL
 #define HAS_CHROOT
+#undef NO_GETADDRINFO
 
 /* DO NOT EDIT BELOW THIS LINE */