mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-08 18:32:53 +03:00
use htonl/ntohl/ntohs/htons from lwip
on bigger systems, you don't simply write endian.h
This commit is contained in:
1 parent
6498b01552
commit
6d28c3154e
6 files changed
+2
-25
No files matched your search
@@ -26,6 +26,7 @@
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
|
||||
+1
-3
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <lwip/opt.h>
|
||||
#include <lwip/debug.h>
|
||||
#include <lwip/def.h> /* provide ntohs, htons */
|
||||
|
||||
#define WITH_LWIP 1
|
||||
|
||||
@@ -13,9 +14,6 @@
|
||||
* building in */
|
||||
#define HAVE_STRNLEN 1
|
||||
|
||||
/* provide what usually resides in arpa/inet.h: ntohs and htons. maybe it'd be a better way to just have an arpa/inet.h compatibility file in lwip? */
|
||||
#define HAVE_ENDIAN_H 1
|
||||
|
||||
/* FIXME just a quick hack */
|
||||
#define COAP_TICKS_PER_SECOND 10
|
||||
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
#include "endian.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TIME_H
|
||||
#include <time.h>
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
/* endianness helpers for lwip port */
|
||||
|
||||
/* FIXME: i'm sure there is something in lwip we can use */
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/* we're on little endian, ntohs & co swap */
|
||||
static inline uint16_t ntohs(uint16_t x)
|
||||
{
|
||||
return (x << 8) | (x >> 8);
|
||||
}
|
||||
|
||||
#define htons ntohs
|
||||
@@ -25,9 +25,6 @@
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef HAVE_ENDIAN_H
|
||||
#include "endian.h"
|
||||
#endif
|
||||
|
||||
#ifdef WITH_LWIP
|
||||
#include <lwip/pbuf.h>
|
||||
|
||||
Reference in new issue
Block a user