Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys de-__P



details:   https://anonhg.NetBSD.org/src/rev/353380399504
branches:  trunk
changeset: 573625:353380399504
user:      perry <perry%NetBSD.org@localhost>
date:      Thu Feb 03 19:16:10 2005 +0000

description:
de-__P
Also, re-arrange to prevent the #define versions of XtoY functions
from coming before the function prototypes.

XXX This is rather ugly, and someone like kleink should probably check
that I didn't mess up any standards issues.

diffstat:

 sys/sys/endian.h |  55 ++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 32 insertions(+), 23 deletions(-)

diffs (76 lines):

diff -r c0d54c29e2e1 -r 353380399504 sys/sys/endian.h
--- a/sys/sys/endian.h  Thu Feb 03 17:30:33 2005 +0000
+++ b/sys/sys/endian.h  Thu Feb 03 19:16:10 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: endian.h,v 1.14 2004/09/13 10:52:34 tron Exp $ */
+/*     $NetBSD: endian.h,v 1.15 2005/02/03 19:16:10 perry Exp $        */
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -44,6 +44,37 @@
 #define        _BIG_ENDIAN     4321    /* MSB first: 68000, ibm, net */
 #define        _PDP_ENDIAN     3412    /* LSB first in word, MSW first in long */
 
+
+#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
+#ifndef _LOCORE
+
+/* C-family endian-ness definitions */
+
+#include <sys/ansi.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#ifndef in_addr_t
+typedef __in_addr_t    in_addr_t;
+#define        in_addr_t       __in_addr_t
+#endif
+
+#ifndef in_port_t
+typedef __in_port_t    in_port_t;
+#define        in_port_t       __in_port_t
+#endif
+
+__BEGIN_DECLS
+uint32_t htonl(uint32_t) __attribute__((__const__));
+uint16_t htons(uint16_t) __attribute__((__const__));
+uint32_t ntohl(uint32_t) __attribute__((__const__));
+uint16_t ntohs(uint16_t) __attribute__((__const__));
+__END_DECLS
+
+#endif /* !_LOCORE */
+#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
+
+
 #include <machine/endian_machdep.h>
 
 /*
@@ -72,28 +103,6 @@
 #define BYTE_ORDER     _BYTE_ORDER
 
 #ifndef _LOCORE
-/* C-family endian-ness definitions */
-
-#include <sys/ansi.h>
-#include <sys/cdefs.h>
-#include <sys/types.h>
-
-#ifndef in_addr_t
-typedef __in_addr_t    in_addr_t;
-#define        in_addr_t       __in_addr_t
-#endif
-
-#ifndef in_port_t
-typedef __in_port_t    in_port_t;
-#define        in_port_t       __in_port_t
-#endif
-
-__BEGIN_DECLS
-uint32_t       htonl __P((uint32_t)) __attribute__((__const__));
-uint16_t       htons __P((uint16_t)) __attribute__((__const__));
-uint32_t       ntohl __P((uint32_t)) __attribute__((__const__));
-uint16_t       ntohs __P((uint16_t)) __attribute__((__const__));
-__END_DECLS
 
 /*
  * Macros for network/external number representation conversion.



Home | Main Index | Thread Index | Old Index