Skip to content

Commit

Permalink
Define use LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS for NetBSD/OpenBSD i…
Browse files Browse the repository at this point in the history
…nstead of ignoring compile errors
  • Loading branch information
schwabe committed Sep 16, 2024
1 parent 07eb3e6 commit 0afb5bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
11 changes: 5 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ target_compile_definitions(lwipcontribunixsys PRIVATE ${LWIP_DEFINITIONS} ${LWIP
target_link_libraries(lwipcontribunixsys PUBLIC ${LWIP_MBEDTLS_LINK_LIBRARIES})
target_link_libraries(lwipcontribunixsys PUBLIC Threads::Threads)


if (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
target_compile_definitions(lwipcontribunixsys PUBLIC -DLWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS)
endif ()

# Avoid format specifies type 'unsigned long' but the argument has type 'clock_t' (aka 'int') warning
target_compile_options(lwipcontribunixsys PRIVATE -Wno-format)

Expand Down Expand Up @@ -91,9 +96,3 @@ if (NOT "${HAVE_ARC4RANDOM}")
endif()
target_link_libraries(lwipovpn PRIVATE ${LWIP_SANITIZER_LIBS} lwipcontribexamples lwipcontribapps lwipcontribaddons lwipallapps lwipcontribunixsys lwipcore lwipmbedtls)


# Ignore htons redefined error
if (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
target_compile_options(lwipcontribunixsys PRIVATE -Wno-macro-redefined)
target_compile_options(lwipovpn PRIVATE -Wno-macro-redefined)
endif ()
18 changes: 3 additions & 15 deletions app/unixaf_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,37 +33,27 @@
*/

/* C runtime includes */
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <time.h>
//#include <stdio.h>
//#include <stdlib.h>
//#include <time.h>
#include <string.h>
#include <stdbool.h>

/* lwIP core includes */
#include "lwip/opt.h"

#include "lwip/sys.h"
#include "lwip/timeouts.h"
#include "lwip/debug.h"
#include "lwip/stats.h"
#include "lwip/init.h"
#include "lwip/tcpip.h"
#include "lwip/netif.h"
#include "lwip/api.h"

#include "lwip/tcp.h"
#include "lwip/udp.h"
#include "lwip/dns.h"
#include "lwip/dhcp.h"
#include "lwip/autoip.h"

/* lwIP netif includes */
#include "lwip/etharp.h"
#include "netif/ethernet.h"

/* applications includes */
#include "lwip/apps/netbiosns.h"
#include "lwip/apps/httpd.h"
#include "apps/httpserver/httpserver-netconn.h"
#include "apps/netio/netio.h"
Expand Down Expand Up @@ -92,8 +82,6 @@

#include "unixaf.h"

#include "netif/ppp/ppp_opts.h"

/* include the port-dependent configuration */
#include "afunix_config.h"

Expand Down

0 comments on commit 0afb5bf

Please sign in to comment.