mirror of
https://github.com/moparisthebest/curl
synced 2024-12-24 00:58:48 -05:00
lib: fix warnings found when porting to NuttX
- Undefine DEBUGASSERT in curl_setup_once.h in case it was already defined as a system macro. - Don't compile write32_le in curl_endian unless CURL_SIZEOF_CURL_OFF_T > 4, since it's only used by Curl_write64_le. - Include <arpa/inet.h> in socketpair.c. Closes https://github.com/curl/curl/pull/4756
This commit is contained in:
parent
779b415a2a
commit
4b463992e5
@ -81,6 +81,7 @@ unsigned short Curl_read16_be(const unsigned char *buf)
|
|||||||
((unsigned short)buf[1]));
|
((unsigned short)buf[1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (CURL_SIZEOF_CURL_OFF_T > 4)
|
||||||
/*
|
/*
|
||||||
* write32_le()
|
* write32_le()
|
||||||
*
|
*
|
||||||
@ -100,7 +101,6 @@ static void write32_le(const int value, unsigned char *buffer)
|
|||||||
buffer[3] = (char)((value & 0xFF000000) >> 24);
|
buffer[3] = (char)((value & 0xFF000000) >> 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (CURL_SIZEOF_CURL_OFF_T > 4)
|
|
||||||
/*
|
/*
|
||||||
* Curl_write64_le()
|
* Curl_write64_le()
|
||||||
*
|
*
|
||||||
|
@ -374,6 +374,7 @@ typedef int sig_atomic_t;
|
|||||||
* Macro used to include assertion code only in debug builds.
|
* Macro used to include assertion code only in debug builds.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#undef DEBUGASSERT
|
||||||
#if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H)
|
#if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H)
|
||||||
#define DEBUGASSERT(x) assert(x)
|
#define DEBUGASSERT(x) assert(x)
|
||||||
#else
|
#else
|
||||||
|
@ -40,6 +40,9 @@
|
|||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h> /* IPPROTO_TCP */
|
#include <netinet/in.h> /* IPPROTO_TCP */
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_ARPA_INET_H
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
#ifndef INADDR_LOOPBACK
|
#ifndef INADDR_LOOPBACK
|
||||||
#define INADDR_LOOPBACK 0x7f000001
|
#define INADDR_LOOPBACK 0x7f000001
|
||||||
#endif /* !INADDR_LOOPBACK */
|
#endif /* !INADDR_LOOPBACK */
|
||||||
|
Loading…
Reference in New Issue
Block a user