-// Aus CygWin's /usr/include/asm/byteorder.h zusammenkopiert
-// Es gibt keine weitere Definition von __constant_ntohl
+extern __inline__ unsigned int ntohl(unsigned int);
+__inline__ unsigned int ntohl2(unsigned int);
+static __inline__ unsigned int ntohl3(unsigned int);
-typedef unsigned long uint32_t;
+extern __inline__ unsigned int xntohl(unsigned int a) { return 1; }
+__inline__ unsigned int xntohl2(unsigned int a) { return 2; }
+static __inline__ unsigned int xntohl3(unsigned int a) { return 3; }
-extern __inline__ uint32_t __ntohl(uint32_t);
-extern __inline__ uint32_t __constant_ntohl(uint32_t);
-
-extern __inline__ uint32_t
-__ntohl(uint32_t x)
-{
- __asm__("xchgb %b0,%h0\n\t" /* swap lower bytes */
- "rorl $16,%0\n\t" /* swap words */
- "xchgb %b0,%h0" /* swap higher bytes */
- :"=q" (x)
- : "0" (x));
- return x;
-}
-
-#define __constant_ntohl(x) \
- ((uint32_t)((((uint32_t)(x) & 0x000000ffU) << 24) | \
- (((uint32_t)(x) & 0x0000ff00U) << 8) | \
- (((uint32_t)(x) & 0x00ff0000U) >> 8) | \
- (((uint32_t)(x) & 0xff000000U) >> 24)))
+// only xntohl2 should be globally visible
+// the others should not even exist in the object file
int main(void)
{