Skip to content

Commit

Permalink
fixup! examples: add POSIX socket example
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Sep 22, 2015
1 parent c6e8d8b commit f15f9c3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sys/posix/include/sys/bytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ extern "C" {
* @return The argument value converted from host to network byte
* order.
*/
#ifndef htonl
#define htonl(hostlong) HTONL(hostlong)
#endif

/**
* @brief Convert values between host and network byte order.
Expand All @@ -50,7 +52,9 @@ extern "C" {
* @return The argument value converted from host to network byte
* order.
*/
#ifndef htons
#define htons(hostshort) HTONS(hostshort)
#endif

/**
* @brief Convert values between host and network byte order.
Expand All @@ -63,7 +67,9 @@ extern "C" {
* @return The argument value converted from network to host byte
* order.
*/
#ifndef ntohl
#define ntohl(netlong) NTOHL(netlong)
#endif

/**
* @brief Convert values between host and network byte order.
Expand All @@ -76,7 +82,9 @@ extern "C" {
* @return The argument value converted from network to host byte
* order.
*/
#ifndef ntohs
#define ntohs(netshort) NTOHS(netshort)
#endif

typedef size_t socklen_t; /**< socket address length */

Expand Down

0 comments on commit f15f9c3

Please sign in to comment.