cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl and curllib on Interix/SFU

From: Nedelcho Stanev <decho_at_gmx.co.uk>
Date: Fri, 8 Nov 2002 21:43:57 +0100

Hya all,

i try to compile curl on sfu 3.0 and i have some probs with compilation
so i made little patch for interix.Is someone need its, they are welcome
i know that may be this is not a best way, but it's work :)

Best wishes,
decho

<<<<<<< file if2ip.h.diff

--- old/if2ip.h Fri Nov 8 18:39:27 2002
+++ if2ip.h Wed Sep 4 16:19:40 2002
@@ -30,37 +30,4 @@ extern char *Curl_if2ip(char *interface,
#define Curl_if2ip(a,b,c) NULL
#endif
+#ifdef __INTERIX
+struct ifreq
+{
+#define IFNAMSIZ 16
+#define IFHWADDRLEN 6
+ union
+ {
+ char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ } ifr_ifrn;
+
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short ifru_flags;
+ int ifru_metric;
+ int ifru_mtu;
+ } ifr_ifru;
+};
+
+#define ifr_name ifr_ifrn.ifrn_name /* interface name */
+#define ifr_addr ifr_ifru.ifru_addr /* address */
+#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
+#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
+#define ifr_flags ifr_ifru.ifru_flags /* flags */
+#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
+#define ifr_metric ifr_ifru.ifru_metric /* metric */
+#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
+
+#define SIOCGIFADDR _IOW('s', 102, struct ifreq) /* Get if addr */
+#endif /*interix*/
+
#endif

<<<<<<< end of file

<<<<<<< file if2ip.c.diff

--- old/if2ip.c Fri Nov 8 18:44:42 2002
+++ if2ip.c Wed Sep 4 16:19:40 2002
@@ -26,9 +26,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#ifdef __INTERIX
+#include <sys/socket.h>
+#endif
#ifdef HAVE_UNISTD_H
@@ -108,11 +105,8 @@ char *Curl_if2ip(char *interface, char *
}
else {
struct in_addr in;

+#ifndef __INTERIX
struct sockaddr_in *s = (struct sockaddr_in *)&req.ifr_dstaddr;
+#else
+ struct sockaddr_in *s = (struct sockaddr_in *)&req.ifr_addr;
+#endif
memcpy(&in, &(s->sin_addr.s_addr), sizeof(in));
#if defined(HAVE_INET_NTOA_R)
ip = inet_ntoa_r(in,buf,buf_size);

<<<<<<< end of file

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

  • application/x-pkcs7-signature attachment: smime.p7s
Received on 2002-11-09