diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2016-08-06 22:13:52 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2016-08-06 22:13:52 +0200 |
commit | 399636f98453bdc1fca19b4dbc742993549aa6c3 (patch) | |
tree | 5509d4b148c973a464dcb92cd1c327e75238c890 /cmake | |
parent | eff8d3f3fb1b77dcaaa2d8799cbb6c528ed33eb8 (diff) | |
download | weechat-399636f98453bdc1fca19b4dbc742993549aa6c3.zip |
api: fix connection to servers with hook_connect() on Windows 10 with Windows subsystem for Linux (closes #770)
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindSocketpair.cmake | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/cmake/FindSocketpair.cmake b/cmake/FindSocketpair.cmake new file mode 100644 index 000000000..cc6c7d968 --- /dev/null +++ b/cmake/FindSocketpair.cmake @@ -0,0 +1,40 @@ +# +# Copyright (C) 2016 Sébastien Helleu <flashcode@flashtux.org> +# +# This file is part of WeeChat, the extensible chat client. +# +# WeeChat is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# WeeChat is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with WeeChat. If not, see <http://www.gnu.org/licenses/>. +# + +# - Find Socketpair +# This module finds if socketpair function is available and supports SOCK_DGRAM. +# + +if(SOCKETPAIR_FOUND) + # Already in cache, be silent + set(SOCKETPAIR_FIND_QUIETLY TRUE) +endif() + +include(CheckCSourceRuns) + +set(CMAKE_REQUIRED_FLAGS -Werror) +check_c_source_runs(" + #include <sys/types.h> + #include <sys/socket.h> + int main() { + int socket[2]; + int rc = socketpair (AF_LOCAL, SOCK_DGRAM, 0, socket); + return (rc == 0) ? 0 : 1; + } +" HAVE_SOCKETPAIR_SOCK_DGRAM) |