Symbian platform (C++)
SDK native APIs, runtime and tooling
Loading...
Searching...
No Matches
network_byte_order.h
Go to the documentation of this file.
1// Copyright 2026 The Symbian SDK Authors.
2// Licensed under the Apache License, Version 2.0.
3// nghttp2 needs byte order conversions, not a POSIX socket implementation.
4#ifndef SYMBIAN_WEBSOCKET_NETWORK_BYTE_ORDER_H_
5#define SYMBIAN_WEBSOCKET_NETWORK_BYTE_ORDER_H_
6#include <stdint.h>
7#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
8#define htonl(value) __builtin_bswap32((uint32_t)(value))
9#define htons(value) __builtin_bswap16((uint16_t)(value))
10#else
11#define htonl(value) ((uint32_t)(value))
12#define htons(value) ((uint16_t)(value))
13#endif
14#define ntohl(value) htonl(value)
15#define ntohs(value) htons(value)
16#endif