From: "Jerry Miller" <gmiller@cs.sunysb.edu>
To: <help-gcc@gnu.org>
Subject: Re: gcc compiler
Date: Thu, 22 Feb 2001 17:48:00 -0000 [thread overview]
Message-ID: <004d01c09d38$e44c50f0$1e0ef582@cs.sunysb.edu> (raw)
In-Reply-To: <C38F782982CAD111A73600805FE65FC51A2674@exchange07.comp.pge.com>
I assume this is from the book "WinSock 2.0".
If so, you will have to make the following changes
to the includes::
#ifdef WINDOWS
#include <windows.h>
#define SD_BOTH 2
#else
#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define SOCKET int
#define SOCKET_ERROR -1
#define SD_RECEIVE 0
#define SD_SEND 1
#define SD_BOTH 2
#define FAR
#define WSAGetLastError() h_errno
#define WSANO_DATA NO_DATA
#define SOCKET int
#define INVALID_SOCKET -1
#define closesocket(s) close((s))
#define strnicmp(a,b,c) strncasecmp((a),(b),(c))
#ifdef SOLARIS
#define INADDR_NONE (in_addr_t) -1
#endif
#endif
You will also have to modify the code as follows:
#ifdef WINDOWS
server_sockaddr.sin_addr = *((LPIN_ADDR) *host_entry->h_addr_list);
#else
#ifdef SOLARIS
server_sockaddr.sin_addr.s_addr = *(unsigned long *) (host_entry->h_addr);
for (i=0; i<8; i++) server_sockaddr.sin_zero[i] = 0;
#else
server_sockaddr.sin_addr.s_addr = host_entry?*(unsigned long
*)(host_entry->h_addr):host.s_addr;
#endif
#endif
(I'm not sure this is exact, since I've modified the code for my own
purposes.
This is excerpted from a book I've written, "Designing Spiders and Robots in
C/C++ (and Perl) for UNIX/Solaris/Linux/Posix and Windows 95/98/NT".)
----- Original Message -----
From: Salari, Morris M <MMSc@pge.com>
To: <help-gcc@gnu.org>
Sent: Thursday, February 22, 2001 8:04 PM
Subject: gcc compiler
> I am trying to compile a C program "http_get.c" with gcc compiler
> on Unix Solaris 2.6, it does not compile and gcc is giving me attaced
> error file. Please help if you could.
> gcc-2.8.1.
> Solaris 2.6.
> Morris Salari
> 415-927-6766 <<gccerror>>
>
next prev parent reply other threads:[~2001-02-22 17:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-22 17:07 Salari, Morris M
2001-02-22 17:48 ` Jerry Miller [this message]
2001-02-23 1:08 ` Jerry Miller
2001-02-23 8:28 ` remote XOpenDisplay in Solaris (SunOS 5.6) Jerry Miller
-- strict thread matches above, loose matches on Subject: below --
2008-05-24 12:44 gcc compiler Miguel de la Ossa
2008-05-24 14:55 ` Tim Prince
2008-05-24 16:00 ` Blake Huff
2002-07-01 22:52 GCC Compiler Ravi Kumar Bhattiprolu
2002-07-01 22:49 Pooyan Sepahvand
2001-05-31 11:39 Ed Hudak
1999-12-29 20:25 GCC compiler Hung Vu
1999-12-29 20:27 ` Jeffrey A Law
1999-12-31 22:24 ` Jeffrey A Law
1999-12-31 22:24 ` Hung Vu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='004d01c09d38$e44c50f0$1e0ef582@cs.sunysb.edu' \
--to=gmiller@cs.sunysb.edu \
--cc=help-gcc@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).