changes ULONG to UINT32 for 64bit netxduo
This commit is contained in:
@@ -56,6 +56,9 @@
|
||||
|
||||
#include "nx_user.h"
|
||||
#endif
|
||||
#include "tx_port.h"
|
||||
typedef unsigned int UINT32;
|
||||
_Static_assert(sizeof(UINT32) == 4, "UINT32 must be 4 bytes");
|
||||
|
||||
/* Default to little endian, since this is what most RISC-V targets are. */
|
||||
|
||||
@@ -63,10 +66,10 @@
|
||||
|
||||
/* Define macros that swap the endian for little endian ports. */
|
||||
#ifdef NX_LITTLE_ENDIAN
|
||||
#define NX_CHANGE_ULONG_ENDIAN(arg) \
|
||||
#define NX_CHANGE_UINT32_ENDIAN(arg) \
|
||||
{ \
|
||||
ULONG _i; \
|
||||
ULONG _tmp; \
|
||||
UINT32 _i; \
|
||||
UINT32 _tmp; \
|
||||
_i = (UINT)arg; \
|
||||
/* _i = A, B, C, D */ \
|
||||
_tmp = _i ^ (((_i) >> 16) | (_i << 16)); \
|
||||
@@ -82,11 +85,11 @@
|
||||
#define NX_CHANGE_USHORT_ENDIAN(a) (a = (((a >> 8) | (a << 8)) & 0xFFFF))
|
||||
|
||||
#ifndef htonl
|
||||
#define htonl(val) NX_CHANGE_ULONG_ENDIAN(val)
|
||||
#define htonl(val) NX_CHANGE_UINT32_ENDIAN(val)
|
||||
#endif /* htonl */
|
||||
|
||||
#ifndef ntohl
|
||||
#define ntohl(val) NX_CHANGE_ULONG_ENDIAN(val)
|
||||
#define ntohl(val) NX_CHANGE_UINT32_ENDIAN(val)
|
||||
#endif /* ntohl */
|
||||
|
||||
#ifndef htons
|
||||
@@ -99,7 +102,7 @@
|
||||
|
||||
#else
|
||||
|
||||
#define NX_CHANGE_ULONG_ENDIAN(a)
|
||||
#define NX_CHANGE_UINT32_ENDIAN(a)
|
||||
#define NX_CHANGE_USHORT_ENDIAN(a)
|
||||
|
||||
#ifndef htons
|
||||
|
||||
Reference in New Issue
Block a user