]> granicus.if.org Git - curl/commitdiff
cmake: fix HAVE_GETHOSTNAME definition
authorPeter Wu <peter@lekensteyn.nl>
Thu, 6 Nov 2014 00:32:43 +0000 (01:32 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 10 Nov 2014 08:07:50 +0000 (09:07 +0100)
Otherwise Curl_gethostname always fails. Windows has gethostname
since Vista according to
http://msdn.microsoft.com/en-us/library/ms738527%28VS.85%29.aspx, but
accordings to byte_bucket's VC 2005 documentation, it is available even
in Windows 95. (possibly after installing a Platform SDK, the
Windows Server 2003 SP1 Platform SDK should be sufficient).

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
CMake/Platforms/WindowsCache.cmake
CMakeLists.txt

index 53d1c6dd77af3a78e47edd676d08bce50bc5857c..6fc2991cd14b81b0714c32021296fcba4850f570 100644 (file)
@@ -5,6 +5,7 @@ if(NOT UNIX)
     set(HAVE_LIBSOCKET 0)
     set(NOT_NEED_LIBNSL 0)
     set(HAVE_LIBNSL 0)
+    set(HAVE_GETHOSTNAME 1)
     set(HAVE_LIBZ 0)
     set(HAVE_LIBCRYPTO 0)
 
index 45f46ec5e1a51aa6e0ba6f668073a68c65e10df6..a325d1c1c18614c9fcc0c898298ff1bb446ffe0a 100644 (file)
@@ -252,6 +252,8 @@ if(NOT NOT_NEED_LIBNSL)
   check_library_exists_concat("nsl"    gethostbyname  HAVE_LIBNSL)
 endif(NOT NOT_NEED_LIBNSL)
 
+check_function_exists(gethostname HAVE_GETHOSTNAME)
+
 if(WIN32)
   check_library_exists_concat("ws2_32" getch        HAVE_LIBWS2_32)
   check_library_exists_concat("winmm"  getch        HAVE_LIBWINMM)