compat: Fix clang compiler error in Android

This includes some missing headers and function declaration and fixes
the following compiler errors.

../compat/htonll.c:27:9: error: call to undeclared function 'htonl'
   27 |     b = htonl (v & 0xffffffff);
      |         ^

../compat/ntohll.c:27:9: error: call to undeclared function 'ntohl'
   27 |     b = ntohl (v & 0xffffffff);
      |         ^

../compat/setproctitle.c:39:47: error: call to undeclared function 'getprogname'
   39 |         used = snprintf(name, sizeof name, "%s: %s", getprogname(), title);
      |                                                      ^

../compat/imsg.c:82:9: error: call to undeclared function 'getdtablesize'
   82 |             >= getdtablesize()) {
      |                ^
pull/3933/head
Biswapriyo Nath 2024-04-11 14:14:44 +00:00
parent 43530d4397
commit 4f5a944ae3
4 changed files with 8 additions and 0 deletions

View File

@ -289,6 +289,11 @@ void explicit_bzero(void *, size_t);
int getdtablecount(void);
#endif
#ifndef HAVE_GETDTABLESIZE
/* getdtablesize.c */
int getdtablesize(void);
#endif
#ifndef HAVE_CLOSEFROM
/* closefrom.c */
void closefrom(int);

View File

@ -14,6 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <arpa/inet.h>
#include <sys/types.h>
#include "compat.h"

View File

@ -14,6 +14,7 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <arpa/inet.h>
#include <sys/types.h>
#include "compat.h"

View File

@ -17,6 +17,7 @@
#include <sys/types.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "compat.h"