From d07834e4be51f1280f8c7dc022c33a7c20e7414b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Fri, 31 Oct 2008 07:51:46 +0000 Subject: [PATCH] Conditional compiling upon getaddrinfo() availability. TODO: replacement code git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2437 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- src/network.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/network.c b/src/network.c index cf2fac4cd..1c48f75d7 100644 --- a/src/network.c +++ b/src/network.c @@ -2,7 +2,7 @@ * Hamlib Interface - network communication low-level support * Copyright (c) 2000-2008 by Stephane Fillod * - * $Id: network.c,v 1.3 2008-10-27 22:18:39 fillods Exp $ + * $Id: network.c,v 1.4 2008-10-31 07:51:46 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -30,6 +30,7 @@ * \file network.c */ +/* needed for getaddrinfo, will not work with Win95/Win98 */ #define WINVER 0x0501 #ifdef HAVE_CONFIG_H @@ -76,8 +77,9 @@ * \param rp port data structure (must spec port id eg hostname:port) * \return RIG_OK or < 0 if error */ -int network_open(hamlib_port_t *rp, int default_port) { - +int network_open(hamlib_port_t *rp, int default_port) +{ +#ifdef HAVE_GETADDRINFO int fd; /* File descriptor for the port */ int status; struct addrinfo hints, *res; @@ -135,6 +137,9 @@ int network_open(hamlib_port_t *rp, int default_port) { rp->fd = fd; return RIG_OK; +#else + return -RIG_ENAVAIL; +#endif } /** @} */