This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] <asm/byteorder.h> missing prototypes warning


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

This is similar in concept to the <stdio.h> patch I just posted to
newlib@.  It looks like I mistakenly removed the prototypes when I was
trying to fix the C99 inline issue in <asm/byteorder.h>.

Since this makes four lines which need the C99 inline workaround, I
decided to make a macro similar to that in <stdio.h>.  I didn't use the
same macro name, since I didn't want to deal with a possible collision
with, or dependency on, <stdio.h>.  Perhaps there is a better way of
dealing with this; I'm certainly open to ideas.

Patch attached.


Yaakov

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAknVfjsACgkQpiWmPGlmQSPH/gCgoxK1UgezIcUwFH3EHc0+rHRB
C14AnRZ2yQhc6uwvJbcQ98hUSxnxP38X
=8YGC
-----END PGP SIGNATURE-----
2009-04-02  Yaakov Selkowitz  <yselkowitz@users.sourceforge.net>

	* include/asm/byteorder.h (__ntohl, __ntohs): Prototype before
	define to avoid a warning with -Wmissing-prototypes.

Index: cygwin/include/asm/byteorder.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/asm/byteorder.h,v
retrieving revision 1.11
diff -u -r1.11 byteorder.h
--- include/asm/byteorder.h	26 Mar 2009 10:40:29 -0000	1.11
+++ include/asm/byteorder.h	3 Apr 2009 01:48:34 -0000
@@ -31,9 +31,15 @@
 extern uint16_t	htons(uint16_t);
 
 #if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
-extern
+#define __ASM_BYTEORDER_INLINE extern __inline__
+#else
+#define __ASM_BYTEORDER_INLINE __inline__
 #endif
-__inline__ uint32_t
+
+__ASM_BYTEORDER_INLINE uint32_t __ntohl(uint32_t x);
+__ASM_BYTEORDER_INLINE uint16_t __ntohs(uint16_t x);
+
+__ASM_BYTEORDER_INLINE uint32_t
 __ntohl(uint32_t x)
 {
 	__asm__("xchgb %b0,%h0\n\t"	/* swap lower bytes	*/
@@ -50,10 +56,7 @@
 		   (((uint32_t)(x) & 0x00ff0000U) >>  8) | \
 		   (((uint32_t)(x) & 0xff000000U) >> 24)))
 
-#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
-extern
-#endif
-__inline__ uint16_t
+__ASM_BYTEORDER_INLINE uint16_t
 __ntohs(uint16_t x)
 {
 	__asm__("xchgb %b0,%h0"		/* swap bytes		*/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]