2007-03-29 Ralf Corsépius <ralf.corsepius@rtems.org>

* libnetworking/netinet/ip.h: Add FreeBSD's alignement macros.
This commit is contained in:
Ralf Corsepius
2007-03-29 14:28:49 +00:00
parent 6209041c60
commit ef0b69d12f
2 changed files with 4 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
2007-03-29 Ralf Corsépius <ralf.corsepius@rtems.org> 2007-03-29 Ralf Corsépius <ralf.corsepius@rtems.org>
* libnetworking/netinet/ip.h: Add FreeBSD's alignement macros.
* libnetworking/net/netisr.h: Partial update from FreeBSD. * libnetworking/net/netisr.h: Partial update from FreeBSD.
* libcsupport/src/getpwent.c: Remove bogus cast to long. * libcsupport/src/getpwent.c: Remove bogus cast to long.
* libnetworking/libc/strsep.c: Don't build if provided by libc. * libnetworking/libc/strsep.c: Don't build if provided by libc.

View File

@@ -48,8 +48,10 @@
#ifndef __packed #ifndef __packed
#if defined(__GNUC__) #if defined(__GNUC__)
#define __packed __attribute__((packed)) #define __packed __attribute__((packed))
#define __aligned(x) __attribute__((aligned(x)))
#else #else
#define __packed #define __packed
#define __aligned(x)
#endif #endif
#endif #endif
@@ -81,7 +83,7 @@ struct ip {
u_char ip_p; /* protocol */ u_char ip_p; /* protocol */
u_short ip_sum; /* checksum */ u_short ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */ struct in_addr ip_src,ip_dst; /* source and dest address */
} __packed; } __packed __aligned(4);
#ifdef _IP_VHL #ifdef _IP_VHL
#define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl)) #define IP_MAKE_VHL(v, hl) ((v) << 4 | (hl))