Skip to content

Commit

Permalink
cmake: fix HAVE_GETHOSTNAME definition
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lekensteyn authored and bagder committed Nov 10, 2014
1 parent 7bdfdd0 commit 10286f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMake/Platforms/WindowsCache.cmake
Expand Up @@ -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)

Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -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)
Expand Down

0 comments on commit 10286f4

Please sign in to comment.