Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Oct 2000 09:54:02 -0700
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Karganov Konstantin <kostik@balrog.po.cs.msu.su>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: undefined macro in sys/socket.h
Message-ID:  <20001012095402.G272@fw.wintelcom.net>
In-Reply-To: <Pine.BSF.4.21.0010121956300.44771-100000@balrog.po.cs.msu.su>; from kostik@balrog.po.cs.msu.su on Thu, Oct 12, 2000 at 08:02:12PM %2B0400
References:  <Pine.BSF.4.21.0010121956300.44771-100000@balrog.po.cs.msu.su>

next in thread | previous in thread | raw e-mail | index | archive | help
* Karganov Konstantin <kostik@balrog.po.cs.msu.su> [001012 09:08] wrote:
> 
> sys/socket.h uses macro ALIGN() and neither defines it nor includes
> correct header ( machine/param.h ?)
> It's a bug or a feature?
> 
> (Surely it's not a problem to include it manually, but...
>  ...isn't it the thing '#include' was desighned for?)

#include shouldn't be a catch-all for such things, for instance one
needs to include sys/types.h before including sys/socket.h.

I'm not sure about the machine/param.h issue for ALIGN, I have this
in my code that uses filedescriptor passing:

/* solaris needs this to show proper fields */
#define _XPG4_2

#include <sys/types.h>
#include <sys/uio.h>
#include <sys/socket.h>

#ifdef __FreeBSD__
#include <machine/param.h>
#endif

#if defined(SOLARIS) || defined(AIX4)
#include <strings.h>
#else
#include <string.h>
#endif

*shrug*, seems to do the trick pretty portably.

-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001012095402.G272>