diff --git a/CMakeLists.txt b/CMakeLists.txt index 07457bd3..cac51e37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,15 +143,6 @@ if (NOT MSVC) if(HAVE_ATTRIBUTE_DESTRUCTOR) set(ATTRIBUTE_DESTRUCTOR "__attribute__((destructor))") endif() - check_c_source_compiles(" - #include - int main() { (void) gethostbyname((const char*) \"\"); return 0; } - " GETHOSTBYNAME_ARG_CAST_CONST) - if(NOT GETHOSTBYNAME_ARG_CAST_CONST) - set(GETHOSTBYNAME_ARG_CAST "(char *)") - else() - set(GETHOSTBYNAME_ARG_CAST "/**/") - endif() check_include_files(arpa/inet.h HAVE_ARPA_INET_H) check_struct_has_member("struct sockaddr_storage" ss_family "sys/socket.h" HAVE_SS_FAMILY) check_struct_has_member("struct sockaddr_storage" __ss_family "sys/socket.h" HAVE_BROKEN_SS_FAMILY) @@ -191,15 +182,6 @@ if (NOT MSVC) check_function_exists(va_copy HAVE_VA_COPY) check_function_exists(__va_copy HAVE___VA_COPY) set(LT_OBJDIR ".libs/") - check_c_source_compiles(" - #include - int main() { (void) send(1, (const char*) \"\", 1, 1); return 0; } - " SEND_ARG2_CAST_CONST) - if(NOT SEND_ARG2_CAST_CONST) - set(SEND_ARG2_CAST "(char *)") - else() - set(SEND_ARG2_CAST "/**/") - endif() check_c_source_compiles(" #include void a(va_list* ap) {}; diff --git a/config.h.cmake.in b/config.h.cmake.in index b631f213..3ff1f42a 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -4,9 +4,6 @@ /* Define if __attribute__((destructor)) is accepted */ #cmakedefine ATTRIBUTE_DESTRUCTOR @ATTRIBUTE_DESTRUCTOR@ -/* Type cast for the gethostbyname() argument */ -#cmakedefine GETHOSTBYNAME_ARG_CAST @GETHOSTBYNAME_ARG_CAST@ - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_ARPA_INET_H 1 @@ -138,9 +135,6 @@ /* Define to the version of this package. */ #define PACKAGE_VERSION "@PACKAGE_VERSION@" -/* Type cast for the send() function 2nd arg */ -#cmakedefine SEND_ARG2_CAST @SEND_ARG2_CAST@ - /* Support for IPv6 */ #cmakedefine SUPPORT_IP6 1 diff --git a/configure.ac b/configure.ac index 84897839..80cee5ea 100644 --- a/configure.ac +++ b/configure.ac @@ -381,36 +381,6 @@ AC_TRY_COMPILE2([ XML_SOCKLEN_T="int"])])]) AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is]) -dnl Checking if gethostbyname() argument is const. -AC_MSG_CHECKING([for const gethostbyname() argument]) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[(void)gethostbyname((const char *)"");]])], -have_gethostbyname_const_arg=yes, -have_gethostbyname_const_arg=no) -AC_MSG_RESULT($have_gethostbyname_const_arg) -if test x"$have_gethostbyname_const_arg" = x"yes"; then - AC_DEFINE([GETHOSTBYNAME_ARG_CAST], [], - [Type cast for the gethostbyname() argument]) -else - AC_DEFINE([GETHOSTBYNAME_ARG_CAST], [(char *)], - [Type cast for the gethostbyname() argument]) -fi - -dnl Checking if send() second argument is const. -AC_MSG_CHECKING([for const send() second argument]) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[(void)send(1,(const char *)"",1,1);]])], -have_send_const_arg2=yes, -have_send_const_arg2=no) -AC_MSG_RESULT($have_send_const_arg2) -if test x"$have_send_const_arg2" = x"yes"; then - AC_DEFINE([SEND_ARG2_CAST], [], - [Type cast for the send() function 2nd arg]) -else - AC_DEFINE([SEND_ARG2_CAST], [(char *)], - [Type cast for the send() function 2nd arg]) -fi - dnl dnl Checking for availability of IPv6 dnl diff --git a/include/win32config.h b/include/win32config.h index 4f99ae0b..bbf3fee8 100644 --- a/include/win32config.h +++ b/include/win32config.h @@ -1,9 +1,6 @@ #ifndef __LIBXML_WIN32_CONFIG__ #define __LIBXML_WIN32_CONFIG__ -#define SEND_ARG2_CAST -#define GETHOSTBYNAME_ARG_CAST - #define HAVE_SYS_STAT_H #define HAVE_STAT #define HAVE_FCNTL_H diff --git a/nanoftp.c b/nanoftp.c index 44bc2a0c..6e6e72dd 100644 --- a/nanoftp.c +++ b/nanoftp.c @@ -88,6 +88,9 @@ #define XML_SOCKLEN_T unsigned int #endif +#define GETHOSTBYNAME_ARG_CAST (char *) +#define SEND_ARG2_CAST (char *) + #define FTP_COMMAND_OK 200 #define FTP_SYNTAX_ERROR 500 #define FTP_GET_PASSWD 331 diff --git a/nanohttp.c b/nanohttp.c index 45d15eeb..379f6b40 100644 --- a/nanohttp.c +++ b/nanohttp.c @@ -85,6 +85,9 @@ #define XML_SOCKLEN_T unsigned int #endif +#define GETHOSTBYNAME_ARG_CAST (char *) +#define SEND_ARG2_CAST (char *) + #ifdef STANDALONE #define DEBUG_HTTP #define xmlStrncasecmp(a, b, n) strncasecmp((char *)a, (char *)b, n)