Skip to content

Commit

Permalink
Fixed undefined header file error on Windows
Browse files Browse the repository at this point in the history
fatal error: arpa/inet.h: No such file or directory

Ticket: None
Changelog: None
Signed-off-by: Lars Erik Wik <[email protected]>
  • Loading branch information
larsewi committed May 2, 2024
1 parent 3eb2377 commit cf1a12b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.63])
AC_INIT([leech], [0.1.9], [https://github.com/larsewi/leech/issues], [leech],
AC_INIT([leech], [0.1.10], [https://github.com/larsewi/leech/issues], [leech],
[https://github.com/larsewi/leech])
AC_CONFIG_SRCDIR([lib/leech.h])

Expand Down
8 changes: 7 additions & 1 deletion lib/buffer.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
#include "buffer.h"

#include <arpa/inet.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>

#ifdef _WIN32
#include <winsock2.h>
#else // _WIN32
#include <arpa/inet.h>
#endif // _WIN32

#include "definitions.h"
#include "files.h"
#include "logger.h"
Expand Down
7 changes: 6 additions & 1 deletion tests/check_buffer.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#include <arpa/inet.h>
#include <check.h>

#ifdef _WIN32
#include <winsock2.h>
#else // _WIN32
#include <arpa/inet.h>
#endif // _WIN32

#include "../lib/buffer.h"

START_TEST(test_LCH_Buffer) {
Expand Down

0 comments on commit cf1a12b

Please sign in to comment.