source: rtems/testsuites/libtests/POSIX/htonl.c @ 7d3f9c6

4.115
Last change on this file since 7d3f9c6 was 7d3f9c6, checked in by Ralf Corsepius <ralf.corsepius@…>, on 02/22/11 at 07:37:03

Add HAVE_CONFIG_H.

  • Property mode set to 100644
File size: 460 bytes
Line 
1/*
2 * Copyright (c) 2010 by
3 * Ralf Corsépius, Ulm, Germany. All rights reserved.
4 *
5 * Permission to use, copy, modify, and distribute this software
6 * is freely granted, provided that this notice is preserved.
7 */
8
9#ifdef HAVE_CONFIG_H
10#include "config.h"
11#endif
12
13#include <arpa/inet.h>
14
15int
16main (void)
17{
18  uint32_t u32;
19  uint16_t u16;
20
21  u32 = htonl(0x12345678);
22  u16 = htons(0x1234);
23
24  u32 = ntohl(0x12345678);
25  u16 = ntohs(0x1234);
26 
27  return 0;
28}
Note: See TracBrowser for help on using the repository browser.